When i Pressed Enter/Return in Keyboard it submits the form without going through my javascript function in the Submit button of the Form.
I’m thinking of manipulating the keyboard command when pressed but i think that would take time.
so, is there any short way of doing so? like an event in the form/button?
Any Answer will help.
Thank you.
PS: sorry for bad explanation.
Assuming “your JavaScript function” is assigned to the submit button’s
clickhandler, it’s obvious why it didn’t work: you didn’t click the submit button. The code to handle a form submission should go onto the form’ssubmithandler. It will trigger from both submit buttons and Enter key.One more critical piece of info: your handler has to return
false, or callpreventDefaulton the event; if you don’t, the form will still submit after your code exits.