Forum Moderators: open

Message Too Old, No Replies

Submit button action

         

kmbarz

5:25 pm on Aug 27, 2004 (gmt 0)

10+ Year Member



I have a fairly long complicated form that is only meant to work on insert to the database. (e.g. if they hit submit, they have to use a different mechanism to edit any data.) As such, I'd like to prevent premature submissions caused by people hitting enter. So, with this button:

<input name="btnSAESubmit" type="submit" value="Submit Form">

is there some way to keep the onclick behavior but disable it from submitting when enter is pressed?

StupidScript

5:28 pm on Aug 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Using:

<input type="button" ... onclick="JSaction()">

instead of a type="submit" will give you a JS-clickable button that does not submit the form.