Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old February 3rd, 2005, 08:17 PM
jweizenblut jweizenblut is offline
Contributing User
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Miami, Fl. US
Posts: 522 jweizenblut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 29 sec
Reputation Power: 2
Send a message via AIM to jweizenblut Send a message via Yahoo to jweizenblut
Reset single value in form....

I have a form in which I have added some error trapping. Part of the error trapping is 2 password verification inputs. I have code that checks to make sure they match and sets the focus back to the original one. I want to make it clear the values entered into those 2 inputs also.
Anyone know how to do this?
My code:

php Code:
Original - php Code
  1.  
  2. <script language="javascript">
  3.         function checkform (form) { 
  4.             if (form.name.selectedIndex == 0) {
  5.                 alert("A name must be selected from the list.");
  6.                 form.name.focus();
  7.                 return false; }
  8.             if (form.psw.value == "") {
  9.                 alert("A password must be entered.");
  10.                 form.psw.focus();
  11.                 return false ; }
  12.             if (form.verifypsw.value == "") {
  13.                 alert("A password must be re-entered.");
  14.                 form.verifypsw.focus();
  15.                 return false ; }
  16.             if (form.psw.value != form.verifypsw.value) {
  17.                 alert("Your passwords did not match. Please enter again.");
  18.                 form.psw.value == "";
  19.                 form.verifypsw.value == "";
  20.                 form.psw.focus();
  21.                 return false ; }
  22.         return true; }
  23.     </script>


Any ideas?

Reply With Quote
  #2  
Old February 3rd, 2005, 08:33 PM
jweizenblut jweizenblut is offline
Contributing User
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Miami, Fl. US
Posts: 522 jweizenblut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 29 sec
Reputation Power: 2
Send a message via AIM to jweizenblut Send a message via Yahoo to jweizenblut
RE: Reset single value in form....

Figured it out.
Using:

document.volunteer.psw.value = "";

Reply With Quote
  #3  
Old February 3rd, 2005, 08:38 PM
Blindeddie Blindeddie is offline
Codewalkers Regular (2000 - 2499 posts)
 
Join Date: Apr 2007
Location: NJ - USA
Posts: 2,152 Blindeddie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 4
RE: Reset single value in form....

remember... == denotes equality and = is used for assignment

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > Reset single value in form....


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway