SUBMIT button

B

Bahram

Hi
How can I make sure that my form is submitted to the
database when the [SUBMIT] button is clicked on and not
by hitting [Enter] key on the keyboard.
Thank You.
 
T

Ted Ljong

Try this it´s from javascript.internet.com
Ted Ljong

1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function onKeyPress () {
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;
if (keycode == 13) {
alert("Please Click on the Submit button to send this");
return false
}
return true
}
document.onkeypress = onKeyPress;
// End -->
</script>
</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<input type="text">
<input type=submit>
 
B

Bahram

Thanks. It works great.
-----Original Message-----
Try this it´s from javascript.internet.com
Ted Ljong

1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function onKeyPress () {
var keycode;
if (window.event) keycode = window.event.keyCode;
else if (e) keycode = e.which;
else return true;
if (keycode == 13) {
alert("Please Click on the Submit button to send this");
return false
}
return true
}
document.onkeypress = onKeyPress;
// End -->
</script>
</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->
<BODY>
<input type="text">
<input type=submit>


"Bahram" <[email protected]> skrev i meddelandet
Hi
How can I make sure that my form is submitted to the
database when the [SUBMIT] button is clicked on and not
by hitting [Enter] key on the keyboard.
Thank You.


.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top