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

Reset Form

Expand Messages
  • soccer_m_2000
    I ve found info about this all over the web, but I can t seem to make any of it work for me. I have a form, that I want to have reset (as if the reset
    Message 1 of 9 , Apr 16, 2008
    • 0 Attachment
      I've found info about this all over the web, but I can't seem to make
      any of it work for me. I have a form, that I want to have "reset" (as
      if the reset button had been pushed) after it is submitted. I've
      tried the following: document.getElementById('frmCreateUser').reset()

      When I run this however, I get an error stating "This object does not
      support this property or method." Like I said I've seen reference to
      the reset method all over. The normal reset button works, but I want
      to invoke this via code right after the form is submitted.

      Any ideas?
    • Michael Horowitz
      No reason to use javascript for this at all This can be done in html. http://www.htmlcodetutorial.com/forms/_INPUT_TYPE_RESET.html ... [Non-text portions of
      Message 2 of 9 , Apr 17, 2008
      • 0 Attachment
        No reason to use javascript for this at all

        This can be done in html.
        http://www.htmlcodetutorial.com/forms/_INPUT_TYPE_RESET.html

        soccer_m_2000 wrote:
        >
        > I've found info about this all over the web, but I can't seem to make
        > any of it work for me. I have a form, that I want to have "reset" (as
        > if the reset button had been pushed) after it is submitted. I've
        > tried the following: document.getElementById('frmCreateUser').reset()
        >
        > When I run this however, I get an error stating "This object does not
        > support this property or method." Like I said I've seen reference to
        > the reset method all over. The normal reset button works, but I want
        > to invoke this via code right after the form is submitted.
        >
        > Any ideas?
        >
        >



        [Non-text portions of this message have been removed]
      • Tim Sabin
        Try breaking this up into 2 lines: var obj = document.getElementById ( frmCreateUser ); obj.reset (); I have a feeling (unsubstantiated) that getElementById
        Message 3 of 9 , Apr 17, 2008
        • 0 Attachment
          Try breaking this up into 2 lines:
          var obj = document.getElementById ('frmCreateUser');
          obj.reset ();

          I have a feeling (unsubstantiated) that getElementById returns an
          Object, which certainly does not support the reset () method.

          You don't show us what frmCreateUser refers to. Are you sure the
          object it refers to supports reset ()?

          --Tim Sabin


          > I've found info about this all over the web, but I can't seem to make
          > any of it work for me. I have a form, that I want to have "reset"
          (as
          > if the reset button had been pushed) after it is submitted. I've
          > tried the following: document.getElementById('frmCreateUser').reset()
          >
          > When I run this however, I get an error stating "This object does not
          > support this property or method." Like I said I've seen reference to
          > the reset method all over. The normal reset button works, but I want
          > to invoke this via code right after the form is submitted.
          >
          > Any ideas?
          >
          >
          > ------------------------------------
          >
          > Visit http://aiaiai.com for more groups to joinYahoo! Groups Links
          >
          >
          >
          >

          --Tim Sabin
        • soccer_m_2000
          I m aware of the Reset button, however this requires the user to click the button to clear the form. I want the form to be cleared automatically after a
          Message 4 of 9 , Apr 22, 2008
          • 0 Attachment
            I'm aware of the Reset button, however this requires the user to click
            the button to clear the form. I want the form to be cleared
            automatically after a successful submission.

            I'll try breaking it up into 2 lines after while and see if that
            works. Seems to me it should work either way, but stranger things
            have happened.


            --- In JavaScript_Official@yahoogroups.com, Michael Horowitz
            <michael@...> wrote:
            >
            > No reason to use javascript for this at all
            >
            > This can be done in html.
            > http://www.htmlcodetutorial.com/forms/_INPUT_TYPE_RESET.html
            >
            > soccer_m_2000 wrote:
            > >
            > > I've found info about this all over the web, but I can't seem to make
            > > any of it work for me. I have a form, that I want to have "reset" (as
            > > if the reset button had been pushed) after it is submitted. I've
            > > tried the following: document.getElementById('frmCreateUser').reset()
            > >
            > > When I run this however, I get an error stating "This object does not
            > > support this property or method." Like I said I've seen reference to
            > > the reset method all over. The normal reset button works, but I want
            > > to invoke this via code right after the form is submitted.
            > >
            > > Any ideas?
            > >
            > >
            >
            >
            >
            > [Non-text portions of this message have been removed]
            >
          • Tim Sabin
            Simply re-display your initial form when the server refreshes. This will re-initialize all the form values to empty. I d suggest that you give the user some
            Message 5 of 9 , Apr 24, 2008
            • 0 Attachment
              Simply re-display your initial form when the server refreshes. This
              will re-initialize all the form values to empty.

              I'd suggest that you give the user some feedback that there was a
              successful submission; otherwise, the user may think that there was an
              error when the form clears. Force the user to acknowledge your
              feedback.


              --Tim Sabin


              > I'm aware of the Reset button, however this requires the user to
              click
              > the button to clear the form. I want the form to be cleared
              > automatically after a successful submission.
              >
              > I'll try breaking it up into 2 lines after while and see if that
              > works. Seems to me it should work either way, but stranger things
              > have happened.
              >
              >
              > --- In JavaScript_Official@yahoogroups.com, Michael Horowitz
              > <michael@...> wrote:
              > >
              > > No reason to use javascript for this at all
              > >
              > > This can be done in html.
              > > http://www.htmlcodetutorial.com/forms/_INPUT_TYPE_RESET.html
              > >
              > > soccer_m_2000 wrote:
              > > >
              > > > I've found info about this all over the web, but I can't seem to
              make
              > > > any of it work for me. I have a form, that I want to
              have "reset" (as
              > > > if the reset button had been pushed) after it is submitted. I've
              > > > tried the following: document.getElementById
              ('frmCreateUser').reset()
              > > >
              > > > When I run this however, I get an error stating "This object
              does not
              > > > support this property or method." Like I said I've seen
              reference to
              > > > the reset method all over. The normal reset button works, but I
              want
              > > > to invoke this via code right after the form is submitted.
              > > >
              > > > Any ideas?
              > > >
              > > >
              > >
              > >
              > >
              > > [Non-text portions of this message have been removed]
              > >
              >
              >
              >
              > ------------------------------------
              >
              > Visit http://aiaiai.com for more groups to joinYahoo! Groups Links
              >
              >
              >
              >

              --Tim Sabin
            • Michael Horowitz
              Really I would want to display a separate thank you page unless the user is likely to want to submit the form again. By default html is stateless and does not
              Message 6 of 9 , Apr 24, 2008
              • 0 Attachment
                Really I would want to display a separate thank you page unless the user
                is likely to want to submit the form again.
                By default html is stateless and does not save the values on the page.


                Tim Sabin wrote:
                >
                > Simply re-display your initial form when the server refreshes. This
                > will re-initialize all the form values to empty.
                >
                > I'd suggest that you give the user some feedback that there was a
                > successful submission; otherwise, the user may think that there was an
                > error when the form clears. Force the user to acknowledge your
                > feedback.
                >
                > --Tim Sabin
                >
                > > I'm aware of the Reset button, however this requires the user to
                > click
                > > the button to clear the form. I want the form to be cleared
                > > automatically after a successful submission.
                > >
                > > I'll try breaking it up into 2 lines after while and see if that
                > > works. Seems to me it should work either way, but stranger things
                > > have happened.
                > >
                > >
                > > --- In JavaScript_Official@yahoogroups.com
                > <mailto:JavaScript_Official%40yahoogroups.com>, Michael Horowitz
                > > <michael@...> wrote:
                > > >
                > > > No reason to use javascript for this at all
                > > >
                > > > This can be done in html.
                > > > http://www.htmlcodetutorial.com/forms/_INPUT_TYPE_RESET.html
                > <http://www.htmlcodetutorial.com/forms/_INPUT_TYPE_RESET.html>
                > > >
                > > > soccer_m_2000 wrote:
                > > > >
                > > > > I've found info about this all over the web, but I can't seem to
                > make
                > > > > any of it work for me. I have a form, that I want to
                > have "reset" (as
                > > > > if the reset button had been pushed) after it is submitted. I've
                > > > > tried the following: document.getElementById
                > ('frmCreateUser').reset()
                > > > >
                > > > > When I run this however, I get an error stating "This object
                > does not
                > > > > support this property or method." Like I said I've seen
                > reference to
                > > > > the reset method all over. The normal reset button works, but I
                > want
                > > > > to invoke this via code right after the form is submitted.
                > > > >
                > > > > Any ideas?
                > > > >
                > > > >
                > > >
                > > >
                > > >
                > > > [Non-text portions of this message have been removed]
                > > >
                > >
                > >
                > >
                > > ------------------------------------
                > >
                > > Visit http://aiaiai.com <http://aiaiai.com> for more groups to
                > joinYahoo! Groups Links
                > >
                > >
                > >
                > >
                >
                > --Tim Sabin
                >
                >



                [Non-text portions of this message have been removed]
              • Leonardo Ghigliani
                Hi. I am using FCKEditor in a CMS application. I use a custom image upload/browser to add images. I am having trouble making relative paths or absolute ones
                Message 7 of 9 , Apr 25, 2008
                • 0 Attachment
                  Hi.

                  I am using FCKEditor in a CMS application.

                  I use a custom image upload/browser to add images.

                  I am having trouble making relative paths or absolute ones but without the
                  domain.

                  They work fine in Firefox but not in IE.



                  I have a page “pageEDIT.aspx” in the root. That page has an iframe where
                  FCKEditor instance’s loads.

                  FCKEditor path is something like
                  “http://localhost:3124/ApplicationDirectory/FCKEditor/editor/fckeditor.htm%c2%94
                  (that’s the page that loads in the iframe a where all the scripts are)

                  I have a “imageSelect.aspx” also in the root.

                  All the images uploaded are in
                  http://localhost:3124/ApplicationDirectory/Files/Images/XXX.jpg



                  So, when I pass from “imageSelect.aspx” to FCKEditor the path
                  “/ApplicationDirectory/Files/Images/XXX.jpg” in FireFox, the image shows
                  well in the editing area, but not in IE.

                  Also tried relative path “../../Files/Images/XXX.jpg” which also Works in
                  FireFox but not in IE.

                  The only way it Works in IE is with the complete url
                  http://localhost:3124/ApplicationDirectory/Files/Images/XXX.jpg but you may
                  realize that this is not correct, since that domain is only a development
                  temporary path



                  In fact, that “3124” is a random port that Visual Studio 2005 adds to the
                  localhost to run a custom development Server (I am wondering if that
                  wouldn’t be the problem, but also wondering why it Works ok in Firefox)



                  Other images shows well and also do work links based on an absolute path
                  starting with slash both in Firefox and IE. I am having problems only in
                  FCKEditor.



                  If I see the source code of the editing area of FCKEditor, the path stills
                  as I pass it, so the script (FCKEditor’s code) does not adds anything to it.
                  If I manually set the full path in the source code of the editing area
                  adding the http://localhost <http://localhost/> ... then the image shows
                  well.



                  I am writing here because it seems that is not an HTML problem, but
                  something related to FCKEditor (JavaScript based) and with Javascript
                  assignment of the path to the src of an img tag.



                  ¿Any suggestion?



                  Thanks in advance.



                  [Non-text portions of this message have been removed]
                • vroomthere
                  I am having the same problem. I have an Add button on my form. Everytime I refresh the form, it will add another record to the database. I have tried to
                  Message 8 of 9 , Apr 26, 2008
                  • 0 Attachment
                    I am having the same problem. I have an Add button on my form.
                    Everytime I refresh the form, it will add another record to the
                    database. I have tried to recode it a few times, but the request
                    value on the Add button stays as 'Submit'. I want to reset it to
                    null or empty string. How do I re-display the form to reset the
                    control values without having user to click the reset button? I am
                    still new at this.

                    Thanks.

                    --- In JavaScript_Official@yahoogroups.com, "Tim Sabin" <tim@...>
                    wrote:
                    >
                    > Simply re-display your initial form when the server refreshes. This
                    > will re-initialize all the form values to empty.
                    >
                    > I'd suggest that you give the user some feedback that there was a
                    > successful submission; otherwise, the user may think that there was
                    an
                    > error when the form clears. Force the user to acknowledge your
                    > feedback.
                    >
                    >
                    > --Tim Sabin
                    >
                    >
                    > > I'm aware of the Reset button, however this requires the user to
                    > click
                    > > the button to clear the form. I want the form to be cleared
                    > > automatically after a successful submission.
                    > >
                    > > I'll try breaking it up into 2 lines after while and see if that
                    > > works. Seems to me it should work either way, but stranger things
                    > > have happened.
                    > >
                    > >
                    > > --- In JavaScript_Official@yahoogroups.com, Michael Horowitz
                    > > <michael@> wrote:
                    > > >
                    > > > No reason to use javascript for this at all
                    > > >
                    > > > This can be done in html.
                    > > > http://www.htmlcodetutorial.com/forms/_INPUT_TYPE_RESET.html
                    > > >
                    > > > soccer_m_2000 wrote:
                    > > > >
                    > > > > I've found info about this all over the web, but I can't seem
                    to
                    > make
                    > > > > any of it work for me. I have a form, that I want to
                    > have "reset" (as
                    > > > > if the reset button had been pushed) after it is submitted.
                    I've
                    > > > > tried the following: document.getElementById
                    > ('frmCreateUser').reset()
                    > > > >
                    > > > > When I run this however, I get an error stating "This object
                    > does not
                    > > > > support this property or method." Like I said I've seen
                    > reference to
                    > > > > the reset method all over. The normal reset button works, but
                    I
                    > want
                    > > > > to invoke this via code right after the form is submitted.
                    > > > >
                    > > > > Any ideas?
                    > > > >
                    > > > >
                    > > >
                    > > >
                    > > >
                    > > > [Non-text portions of this message have been removed]
                    > > >
                    > >
                    > >
                    > >
                    > > ------------------------------------
                    > >
                    > > Visit http://aiaiai.com for more groups to joinYahoo! Groups Links
                    > >
                    > >
                    > >
                    > >
                    >
                    > --Tim Sabin
                    >
                  • MEL
                    Hi: I try to follow the instruction using google map in javascript. Script some times work fine but when i put the values in Your Address Textbox it wont shows
                    Message 9 of 9 , May 12 7:14 AM
                    • 0 Attachment
                      Hi: I try to follow the instruction using google map in javascript. Script some times work fine but when i put the values in Your Address Textbox it wont shows the directions. Other than that if i put the city state and zip it works. Can any one please tell me what i make mistake in the script?

                      Thanks.

                      SCRIPT
                      ----------
                      <html>
                      <head>
                      <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
                      <title>Google Maps JavaScript API Example</title>
                      <script src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAWjFPi89UG-Rb3Who5FDkhRTvPROrRtr9Yene2irq6Hi48Jt9RRRSOu-klp9Mhib3eBbvZWu0LxSZjQ"
                      type="text/javascript"></script>
                      <script type="text/javascript">

                      //<![CDATA[

                      var map;

                      function load() {
                      if (GBrowserIsCompatible()) {
                      map = new GMap2(document.getElementById("map"));
                      map.setCenter(new GLatLng(37.4419, -122.1419), 13);
                      }
                      }
                      //]]>
                      function buttonOnClick()
                      {
                      var fromaddress ;
                      var myaddress;
                      var query;
                      // build the callers address string
                      fromaddress = document.getElementById("youraddress").value + ',' +
                      document.getElementById("yourcity").value +',' +
                      document.getElementById("yourstate").value +',' +
                      document.getElementById("yourazip").value ;
                      myaddress = '1521 Straight Path, Wyandanch, NY 11798';
                      query = fromaddress + " to " + myaddress;
                      document.getElementById("query").innerHTML = query;
                      var dirPanel = document.getElementById("directions1")
                      directions = new GDirections(map, dirPanel ); // make a direction thing
                      directions.load(query); // make the route

                      }

                      </script>
                      <body onload='load();' onunload="GUnload()">
                      <br>
                      <table>
                      <tr>
                      <td>Your Address:</td>
                      <td><input type='text' id='youraddress'></td>
                      </tr>
                      <tr>
                      <td>Your City:</td>
                      <td><input type='text' id='yourcity'></td>
                      </tr>
                      <tr>
                      <td>Your State:</td>
                      <td><input type='text' size='2' id='yourstate'></td>
                      </tr>
                      <tr>
                      <td>Your Zip Code:</td>
                      <td><input type='text' size='5' id='yourazip'></td>
                      </tr>
                      <tr>
                      <td> </td>
                      <td><input type='button' value='Display Route' onclick='buttonOnClick();'></td>
                      </tr>
                      </table>
                      <center><a href="index.html">Back to Home Page</a></center>
                      <br>
                      <center>
                      <div id="map" style="width: 500px; height: 300px" ></div>
                      <div id="query" >   </div>
                      </center>
                      <div id="directions1" style="width: 500px; height: 300px" ></div>
                      </body>
                      </html>



                      ---------------------------------
                      Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

                      [Non-text portions of this message have been removed]
                    Your message has been successfully submitted and would be delivered to recipients shortly.