I have a form with two text boxes, one select drop down and one radio button. When the enter key is pressed, I want
form
Use event.preventDefault() inside user defined function
event.preventDefault()
...
function userFunction(ev) { if(!event.target.send.checked) { console.log('form NOT submit on "Enter" key') ev.preventDefault(); } }
Open chrome console> network tab to see submit on enter