DrDoc

msg:3398586 | 9:57 pm on Jul 18, 2007 (gmt 0) |
<input type='submit' name='submit' value='Next ->' onclick='return submit_check()' /> Your function may return false, but you don't return false to the submit action (which is fired when the button is clicked).
|
Bernard Marx

msg:3398598 | 10:09 pm on Jul 18, 2007 (gmt 0) |
Also, trigger the validation from the form's onsubmit event. The onclick event of the submit button is no good, since many users submit forms by pressing "Enter".
|
horseatingweeds

msg:3398606 | 10:13 pm on Jul 18, 2007 (gmt 0) |
Good grief. Thanks DrDoc. I'm new at this but even I should have seen that.... Do you know why this wouldn't be working in ie? If I leave the inputs blank, submit, than fix them; ie still will not continue to the submit. [edited by: horseatingweeds at 10:31 pm (utc) on July 18, 2007]
|
DrDoc

msg:3398607 | 10:16 pm on Jul 18, 2007 (gmt 0) |
| The onclick event of the submit button is no good, since many users submit forms by pressing "Enter". |
| Very good advice.
|
horseatingweeds

msg:3398633 | 10:57 pm on Jul 18, 2007 (gmt 0) |
Ok, I've put the function in the <form> tag. Here is a problem though. In ie, if I enter faulty information, submit, then fix the information, it will not re-submit. It works ok in FF... I've tried clearing the fields with element.value = ''; but this wont work with the file input. Fooling around with it, I have found that in IE it won't let you correct the file input then submit. You can use the brows button, then it will submit. Is this a bug? Anyone know a work around?
|
rocknbil

msg:3398881 | 10:25 am on Jul 19, 2007 (gmt 0) |
More like a security feature, I think. If it weren't that way, someone could populate the box with C:\path_to\password\file\or\something\else\sensitive. :-)
|
lavazza

msg:3398882 | 10:33 am on Jul 19, 2007 (gmt 0) |
| The onclick event of the submit button is no good, since many users submit forms by pressing "Enter". |
| Very good advice. |
| OK... why is that good advice? (The three browsers I use all fire an onClick event following an Enter key-press)
|
DrDoc

msg:3399200 | 4:21 pm on Jul 19, 2007 (gmt 0) |
But there is no guarantee that all browsers/UAs will do that. If a browser supports JavaScript events, then it should at least support onsubmit on the form. Lowest common denominator. And, I can tell you for a fact that not all browsers used to fire the onclick upon enter key press.
|
|