On this page:
If you click on any of the input boxes in the "IP Address" column, and press the "." or "/" keys (period or slash) it jumps you to the next input box.
Or at least, it does on a desktop browser. On a mobile browser, it doesn't seem to register the onkeypress
event.
This is the code that is enabling the "jump" on period or slash presses:
// Function to jump to next box on . or / keys
function jumpdot(event) {
// Capture pressed key:
var y = event.key;
if (y == "." || y == "/" ) {
// . or / was pressed, jump to next userinput box and prevent typing of . or /
event.preventDefault();
document.getElementsByName(uiNext)[0].focus();
}
}
Is there an easy way to enable that functionality on Mobile phones as well?
edit: Updated website URL
onkeypress
toonkeydown
, also had to change the period and slash keycode (from 46/47 to 190/191). Thanks! But... when I changedvar x = event.which || event.keyCode;
tovar x = event.key;
it didn't work. Can you provide any more guidance? – Orestes