Move the cursor to another field when a certain character is typed using jquery.
If you want to apply for a different character then please find out the correct "event keycode" for that.
use following link to know character keycode.
https://keycode.info/
Lets move towards coding part.
HTML==>
<input id="input1"/><input id="input2"/>
JQury==>
$('#input1').keypress(function(e) {
if(e.keyCode == 32) {
e.preventDefault();
$('#input2').focus();
}
});
use following link to know character keycode.
https://keycode.info/
Lets move towards coding part.
HTML==>
<input id="input1"/><input id="input2"/>
JQury==>
$('#input1').keypress(function(e) {
if(e.keyCode == 32) {
e.preventDefault();
$('#input2').focus();
}
});
Comments
Post a Comment