Quick question.
How do you disable Enter Key when you submit the form?
is there a way in PHP or Javascript?
$('input').on('keydown', function(event) {
var x = event.which;
if (x === 13) {
event.preventDefault();
}
});
Simplest solution:
Don't use a submit-button in the form, but use a normal button.
Using Enter/Return acts as pressing the Submit button
By the way, I personally hate forms that don't allow me to use Enter/Return.
It just feels annoying and slow if you need to grab your mouse to press Submit
Also don't forget that using Enter/Return to submit a form is part of its accessibility. By declining users to submit a form this way, you're negatively impacting people in need of these accessibility features.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With