[Javascript] make CGI not respond to Enter

Dan Costea costea at ssi-schaefer-noell.com
Wed Feb 20 13:24:33 CST 2002


> Is there anything in JavaScript to prevent a form being submitted on
> pressing Enter on a text entry?
>
> TIA
>
> Garry
>

I can give you a solution, but just for all text entry (not just for one):
you don't provide an "submit" type button, but a "button" type button. For
example:

<form id="myForm" action="doAction" method="POST">
 <input type="text" name="param1" value="param1"/>
 <input type="text" name="param2" value="param2"/>
 <input type="text" name="param3" value="param3"/>
 <input type="button" value="Submit" onClick="myForm.submit ()"/>
</form>



Dan.




More information about the Javascript mailing list