- Replace the
button with a submit
- Be progressive, make sure you have a server side version
- Bind your JavaScript to the
submit handler of the form, not the click handler of the button
Pressing enter in the field will trigger form submission, and the submit handler will fire.