SitePoint Sponsor |
|
User Tag List
Results 1 to 7 of 7
Thread: two submits issue
-
Dec 8, 2006, 15:11 #1
- Join Date
- Mar 2005
- Posts
- 166
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
two submits issue
Hi,
I have a form which I need to submit in order to retrieve a few values according to user selections firstly, and then let he finish the filling and then submit it again.
I realize (after some soffering) that the first submition (made by a select input onchange event handler calling a js function) only works while the submit button isn't on the page ( so I hide it using server code based on a value changed after the js function runs).
My issue:
Since the js submit only works while the button isn't loaded, the user can't use the select again to shift their choice...
Already tried: (no luck for any)
Hide the input button using the hidden property.
Reload the page when the select is used.
Any clue?
-
Dec 8, 2006, 20:10 #2
- Join Date
- Nov 2004
- Location
- Nelson BC
- Posts
- 2,310
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
only works while the submit button isn't on the page
-
Dec 10, 2006, 19:56 #3
- Join Date
- Mar 2005
- Posts
- 166
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
thanks jimfraser...it worked
One question: Why the formname.submit() on my js function has something to do whith my inpyt submit button name?
-
Dec 11, 2006, 15:13 #4
- Join Date
- Nov 2004
- Location
- Nelson BC
- Posts
- 2,310
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Basically if you give a form element the name SUBMIT, you are overwriting the form.submit function.
-
Dec 11, 2006, 15:29 #5
- Join Date
- Mar 2005
- Posts
- 166
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
ok. understood...
Thanks again!
-
Dec 12, 2006, 03:56 #6
- Join Date
- Sep 2005
- Location
- Sydney, NSW, Australia
- Posts
- 16,875
- Mentioned
- 25 Post(s)
- Tagged
- 1 Thread(s)
You only override it in IE because IE pollutes the Javascript namespace with shortened versions of HTML references instead of allowing the programmer to decide for themselves what should be set to what. Other browsers don't automatically assign names that you don't want or need for every HTML element in your page.
Stephen J Chapman
javascriptexample.net, Book Reviews, follow me on Twitter
HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
<input name="html5" type="text" required pattern="^$">
-
Dec 12, 2006, 05:26 #7
- Join Date
- Nov 2004
- Location
- Nelson BC
- Posts
- 2,310
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
This test code fails equally well in IE and Firefox:
Code:<html> <head> </head> <body> <form method="post" action="someurl.html"> <input type="submit" name="submit" value="ok" /> </form> <button onclick = "document.forms[0].submit();">click</button> </body> </html>
Bookmarks