Is there a 'Reset'function in JavaScript?

Results 1 to 3 of 3

Thread: Is there a 'Reset'function in JavaScript?

  1. #1
    David Brower Guest

    Default Is there a 'Reset'function in JavaScript?

    Hi there,<BR><BR>Does anyone know of a function/method that will reset a form? I would like to have some client-side validation that checks if a form is valid and, if not, resets the fields to their original values? I&#039d really appreciate any help/ sugestions etc..<BR><BR>Thank you, <BR><BR>David Brower

  2. #2
    Join Date
    Dec 1969

    Default RE: Is there a 'Reset'function in JavaScri

    That would be the reset() method of the form object, funnily enough... Mimics the effect of clicking a reset button. If the form is already populated then it won&#039t reset to the original values, it clears the form (just like a reset button) - you&#039ll need to write a function that iterates over the form stashing values in an array, and then iterates to reset them.<BR><BR>Dunc

  3. #3
    David Brower Guest

    Default RE: Is there a 'Reset'function in JavaScri

    Thanks Duncan that&#039s just what I was looking for!<BR><BR>David<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts