[ACCEPTED]-HTML input box without a form-forms
To get an input box without a form, I would 1 suggest just not using a form.
It can be simply done with the help of a 2 form as follow... i think adding form would 1 provide great stability
To run a function when the user presses 9 enter when focused on the input field, the 8 easiest way would be to have the form tag 7 and run the function using the form's
onSubmit event 6 (because pressing return when focused on 5 an input field submits the form).
If you 4 nevertheless don't want to include the form 3 tag, you can use the
onKeyPress event to catch the 2 return key pressing and call the function 1 from there.
Don't use the form tag. You can easily use 4 JQuery to tie the code to the input control's 3 key press events.
If you are unfamiliar with 2 JQuery, just tie the code directly to the 1 input field key press event.
More Related questions