0
How to make enter key work like tab
for a program if we need enter key behave like tab, means as we press enter key it go to next column for input , how can we do so using java script
3 Respuestas
+ 5
So are you saying that you want the Tab button to behave like Enter? Jesus who would do that.
+ 2
I assume you're doing data entry and people press enter between fields.
Tab indexes (for entry forms)
http://webcheatsheet.com/html/controll_tab_order.php
Doing things on FocusOut...like FocusNext
http://stackoverflow.com/q/7208161
--check out other answers in that thread to fit.
Enter by default submits forms. If you customize this (commonly done to run validate()) you have to add 'return false' either in validate() or in the attribute onSubmit="func();return false;" to stop navigation.
0
javascript this code will not let line change when enter is pressed rather make spaces cdocument.onkeypressed(evt){
if(evt.keycode==13){
evt.prevent default ();
//now input_element_required is the input where it will do
input_element_required.value+=". ";
}
}
here input_element_required is the element where typing will lead to this.
preventedfault() not let enter key change , and then spaces are added in input_element_required then