943,790 Members | Top Members by Rank

Ad:
  • ASP Discussion Thread
  • Unsolved
  • Views: 922
  • ASP RSS
Nov 23rd, 2008
0

Problem with resetting value in form!

Expand Post »
Hi,

I need to reset all the values of elements in my form to empty string. But the problem is that the form can be reset but the variable still holding the value of y previous input.

For exp,
Input 5 value at first time.
Input 2 value at second time. The rest of the 3 field will take the input value I input previously.

Here my reset function:
ASP Syntax (Toggle Plain Text)
  1. function resetForm(formId)
  2. {
  3. var form, elements, elm;
  4. if(document.getElementById)
  5. form = document.getElementById(formId)
  6. else
  7. form = document.forms[formId];
  8.  
  9. form.reset();
  10. elements = form.elements
  11. /**
  12. * Clear default text of text elements
  13. */
  14. for( i=0, elm; elm=elements[i++]; )
  15. {
  16. if (elm.type == "text")
  17. {
  18. elm.value ='';
  19. }
  20. }
  21. }

Help!
Similar Threads
Reputation Points: 37
Solved Threads: 7
Junior Poster
raul15791 is offline Offline
102 posts
since Jun 2008
Nov 27th, 2008
0

Re: Problem with resetting value in form!

How is this ASP related?
Reputation Points: 25
Solved Threads: 7
Junior Poster
Drew is offline Offline
166 posts
since Apr 2004
Nov 27th, 2008
0

Re: Problem with resetting value in form!

I found a solution already. Thanks anyway...
Reputation Points: 37
Solved Threads: 7
Junior Poster
raul15791 is offline Offline
102 posts
since Jun 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP Forum Timeline: MSSQL 2000 COnnect,Retreive, Delete
Next Thread in ASP Forum Timeline: Reading xls without uploading on server





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC