Loading ...
Sorry, an error occurred while loading the content.

Re: how do you reset a form in a dialog?

Expand Messages
  • slapyo
    ... bret, just tried: document.myForm.reset(); it didn t work. the form is quite simple:
    Message 1 of 4 , Jul 30, 2008
    • 0 Attachment
      --- In ydn-javascript@yahoogroups.com, "bretlevy" <bret@...> wrote:
      >
      >
      > reset is a javascript method for a form, not a YUI method. Please
      > see this demo for an example (view the source):
      >
      > http://sandbox.bluelinkdemo.com/sandbox/form_reset_demo.html
      >
      > Note also that reset() returns the fields to their starting values
      > (that is, the values specified in the original html), so if you have
      > this in your page's form:
      >
      > <input type="text" name="x" id="x" value="123">
      >
      > And then you change that field to 789, when you call reset, it will
      > not "clear", it will reset to 123.
      >
      > Note that YUI doesn't really involve itself in the <form>, but be
      > sure to learn about the wonderful YAHOO.util.Connect.setForm call
      > which gathers up all the form fields and values for you to use in an
      > async call (versus really doing and old-school page submit/redraw
      > cycle). ;-)
      >
      > Hope that helps...
      >
      > ~~bret

      bret,

      just tried:
      document.myForm.reset();

      it didn't work.

      the form is quite simple:
      <form name="myForm" method="GET" action="somescript.php">
      <label for="someinput">test:</label><input type="textbox"
      name="someinput" value="" />
      </form>
    Your message has been successfully submitted and would be delivered to recipients shortly.