javascript - how to remove the default focus on submit button in HTML form? -


i have html form on page. when putting value in 1 of text fields in form , press 'enter key' form gets submitted instantly. think happening due default focus on submit button. try remove focus using blur() function, not working. using chrome. there way avoid scenario? suggestions welcome. in advance.

the submit button not focused; enter in text field supposed submit form.

you register handler submit event, , allow if submit button focused @ time submit requested.

however, you'll deliberately breaking way html forms work. not wants submit form using 1 true way of clicking submit button (also, you'll breaking accessibility , may introduce browser-specific bugs).


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -