you can also just change the submit button to a regular button.... and
have the onclick of the button submit your form.....
Friday, March 19, 2004, 2:33:46 PM, you wrote:
SN> Try the code below. Although I think it only works in IE.
SN> Steve Nelson
SN> <HTML>
SN> <HEAD>
SN> <SCRIPT LANGUAGE="_javascript_">
SN> function testForEnter()
SN> {
SN> if (event.keyCode == 13)
SN> {
SN> event.cancelBubble = true;
SN> event.returnValue = false;
SN> }
SN> }
SN> </SCRIPT>
SN> </HEAD>
SN> <BODY>
SN> <FORM id="FORM1" name="FORM1" method="GET" action=""> SN> style="background-color:yellow">
SN> <H3>Form1: Does not stop form submission when user presses ENTER key.</H3>
SN> <INPUT id="text1" name="text1">
SN> <INPUT type="submit" value="Submit">
SN> </FORM>
SN> <FORM id="FORM2" name="FORM2" method="GET" action=""> SN> style="background-color:lightblue">
SN> <H3>Form2: Stops form submission when user presses ENTER key.</H3>
SN> <INPUT id="text2" name="text2" > SN> <INPUT type="submit" value="Submit">
SN> </FORM>
SN> </BODY>
SN> </HTML>
SN> -----Original Message-----
SN> From: Cutter (CF-Talk) [mailto:[EMAIL PROTECTED]
SN> Sent: Friday, March 19, 2004 2:02 PM
SN> To: CF-Talk
SN> Subject: SOT: form submission
SN> How does one keep a form from submitting when a user presses ENTER?
SN> (Only want them to submit from the button...)
SN> Cutter
SN>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

