Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: How to not let form submit when user presses ENTER key?


Message #1 by "Michael Bunger" <michael@r...> on Sat, 10 Nov 2001 06:03:46 -0600
Hello Michael,

Saturday, November 10, 2001, 2:03:46 PM, you wrote:

MB> Hi,

MB> I've got a form with many text boxes and a submit button on it.  If a user
MB> is typing data in a text box then presses ENTER (probably intending to go to
MB> the next text box), the form will submit.  Is there a way to only allow a
MB> form to be submitted if the user clicks the the Submit button with the
MB> mouse?

MB> Thanks in advance for any help you can provide.

MB> Michael Bunger


MB> ---
MB> 
MB> 


try use usual button (<input type=button>) instead of submit...
and inside function for onclick event in this button
call submit function.... (submit())...


i haven't tried this one, but i think it should work
-- 
Best regards,
 Stanislavs                            mailto:stas@z...


  Return to Index