How do I stop the form from submitting when enter is hit? OR how do I call a javascript function when enter is hit in a form field?
Dave Vick
Ranch Hand
Joined: May 10, 2001
Posts: 3244
posted
0
Anthony To call a javascript function use this in your form tag: <form name='myForm' onsubmit='return jsFunction();'> Then have your function return true or false if its ok or not ok to submit it. If you return false the form isn't submitted and you can display an alert box or something else to the user to fix whatever's wrong and try again. hope that helps
------------------ Dave Sun Certified Programmer for the Java� 2 Platform