I have a form that submits if you press the return key in a text input
field, however I don't want this automatic submission to happen. How to
supress this?

Re: Prevent submission of form with return key by McKirahan

McKirahan
Thu Dec 04 10:44:37 CST 2003

"Trev@Work" <bouncer@localhost> wrote in message
news:3fcf5a38$0$386$afc38c87@news.easynet.co.uk...
> I have a form that submits if you press the return key in a text input
> field, however I don't want this automatic submission to happen. How to
> supress this?


Try this; watch for word wrap:

<html>
<head>
<title>formform.htm</title>
</head>
<body>

<form action="formform.htm?1" method="post" name="form1">
<input type="text" value="Return submits form">
<input type="submit" value="Submit 1">
</form>

<form action="formform.htm?2" method="post" name="form2" onsubmit="return
false">
<input type="text" value="Return submits nothing">
<input type="button" value="Submit 2" onclick="document.form2.submit()">
</form>

</body>
</html>




Re: Prevent submission of form with return key by Ray

Ray
Thu Dec 04 22:46:56 CST 2003

I suggest you do NOT do this. ENTER = SUBMIT. That is the standard, and
straying from standards will confuse some users and irritate others. If I
cannot ENTER to submit, I freak out and send hate mail to the webmaster.
There are many people who don't use a mouse still (like, not EVER, but you
know...). At least there's ctrl+M.

Ray at home

"Trev@Work" <bouncer@localhost> wrote in message
news:3fcf5a38$0$386$afc38c87@news.easynet.co.uk...
> I have a form that submits if you press the return key in a text input
> field, however I don't want this automatic submission to happen. How to
> supress this?
>
>