ENTER to Submit Form
- If a form has only one input field then hitting enter in this field triggers form submit (ngSubmit)
- if a form has 2+ input fields and no buttons or input[type=submit] then hitting enter doesn't trigger submit
- If the form has no submit button, then the implicit submission mechanism must do nothing if the form has more than one field that blocks implicit submission.
- if a form has one or more input fields and one or more buttons or input[type=submit] then hitting enter in any of the input fields will trigger the click handler on the first button or input[type=submit] (ngClick) and a submit handler on the enclosing form (ngSubmit)
- If you only have one input, then you don't need
input[type=submit]. Hit ENTER will submit the form.
- If you have more than one blocking input, then hitting ENTER will NOT submit the form unless you have a
- It also means on mobile, even you see search button (because your input is type search), hitting search won't do anything. The fix is to have a hidden submit button so 'search' button works.
ng-submiton the form instead of
button(ng-click)to make sure ENTER works.
Soft Keyboard on Input field
- The 'Go' button is only shown, if the
inputtag is inside a
formtag. Otherwise shows a return button. See: http://stackoverflow.com/questions/22986347
- The 'Search' button is shown when
<input type='search'>or name of the input contains 'search'
- Shows 'Go' for text inputs
- SHows 'Next' to number inputs
- persist form value between back: http://garlicjs.org/