[jQuery] Re: submitting the form by pressing ENTER

2008-03-25 Thread Andy Matthews
2:58 PM To: jQuery (English) Subject: [jQuery] Re: submitting the form by pressing ENTER Hi, Unfortunately, that didn't work for me. Here was my code: $('#pageForm').submit(function() { var page = $('#page').val();

[jQuery] Re: submitting the form by pressing ENTER

2008-03-25 Thread [EMAIL PROTECTED]
Hi, Unfortunately, that didn't work for me. Here was my code: $('#pageForm').submit(function() { var page = $('#page').val(); if (!isInteger(page)) { alert("The page number must be an integer.");

[jQuery] Re: submitting the form by pressing ENTER

2008-03-25 Thread Andy Matthews
You should be able to intercept that button press by using the submit() method of the form object. $('#myForm').submit(function(){ // this method should fire whether the button was clicked with the mouse // or the enter button was pressed return false; });