lulu50
asked on
Stop submitting the form everytime I hit on enter
Hi,
I have a form, that submit the data everytime I hit on enter.
How can I stop, the form from submitting the data if I hit on enter?
Thanks,
Lulu
I have a form, that submit the data everytime I hit on enter.
How can I stop, the form from submitting the data if I hit on enter?
Thanks,
Lulu
Returning false is the keyword to prevent duplicate entrieswhen key is pressed.
if ($textbox.val().length > 0 && e.keyCode == 13) {
$textbox.parent('form').submit();
return false;
}
Is there any script that is submitting the form on press of enter? The selector may be too generic.
ASKER
Big - I tried your code did not work, not sure why
Sammy - what is $textbox? got an error on that it says undefined.
Anthony - no I don't have a script that is submitting my form.
Sammy - what is $textbox? got an error on that it says undefined.
Anthony - no I don't have a script that is submitting my form.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Big,
GREAT!!!!!
That did the trick.
Thank you for your help
GREAT!!!!!
That did the trick.
Thank you for your help
ASKER
Thank you
my pleasure!
Happy Coding :)
Happy Coding :)
Open in new window