How to make recognize submit input for gap?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
22 views
There is a field tagged which should not contain spaces i.e., it should be one word,sometimes users are stupid and try to type in a few words. The challenge when pressing the space bar to do a form submission or override pressing the space bar as pressing enter. You can use jQuery
by | 22 views

1 Answer

0 like 0 dislike
myForm.addEventListener('keypress', function(evt){ if (evt.which == 32 || evt.keyCode == 32) { evt.preventDefault() myForm.submit() } })
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
110,608 questions
257,187 answers
0 comments
40,796 users