javascript - what will be the code to move to previous textfield? -


I have a code if I press the button below it goes to the next textfield but what is the code to go to the previous text file

  & lt; Html & gt; & Lt; Top & gt; & Lt; Script language = "javascript" & gt; Function handleCodeOVAN (elementRef, eventRef) {var charCode = (window.event)? EventRef.keyCode: eventRef.which; // warning (charCode); // arrow key (37: left, 38: up, 39: right, 40: bottom) ... if (charcoda == 40) {if (window.event) window.event.keyCode = 9; Other events Which = 9; Back true; } Back true; } & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Width of table = "433" range = "1" cell area = "0" cellpadding = "0" & ​​gt; & Lt; TR & gt; & Lt; Td width = "235" align = "center" & gt; & Gt; Input type = "text" onKeyDown = "handeldevan event (this, incident);" Onkeyup = "handleKeyUpEvent (this event);" & Gt; & Lt; / TD & gt; & Lt; Td width = "235" align = "center" & gt; & Gt; Input type = "text" onKeyDown = "handeldevan event (this, incident);" Onkeyup = "handleKeyUpEvent (this event);" & Gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td width = "235" align = "center" & gt; & Gt; Input type = "text" onKeyDown = "handeldevan event (this, incident);" Onkeyup = "handleKeyUpEvent (this event);" & Gt; & Lt; / TD & gt; & Lt; Td width = "235" align = "center" & gt; & Gt; Input type = "text" onKeyDown = "handeldevan event (this, incident);" Onkeyup = "handleKeyUpEvent (this event);" & Gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; Input type = "radio" id = "check" name = "check" checked & gt; & Lt; / TD & gt; & Lt; TD & gt; & Lt; Input type = "radio" id = "check" name = "check" checked & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; Td> & Lt; Input type = "checkbox" id = "check" name = "check" & gt; & Lt; / Td> & Lt; Td> & Lt; Input type = "checkbox" id = "check" name = "check" & gt; & Lt; / Td> & Lt; / TR & gt; & Lt; / Table & gt; & Lt; / Body & gt; & Lt; / Html & gt;    

In your code, the keycod is simulating the 9 'Tab' key pressing. Basically what you want to do to move backwards, 'shift' + 'tab' is to simulate the shift code is 16, so a window.event.keyCode = 16; With line 9 above the same line, and one event.which = 16; above the second.

If this does not work, you may need to store them in some way so that the key-up event associated with the shift key event triggers the simulated press tab. This can be done by adding another event handler to you before or after that the handler should be similar to what you already have, but change it to keyboard handler and check key 16 rather than 40.


Comments

Popular posts from this blog

windows - Heroku throws SQLITE3 Read only exception -

lex - Building a lexical Analyzer in Java -

python - rename keys in a dictionary -