User manual - Web_Browser_Prog_Guide

NAURTECH WEB BROWSER SMART CLIENTS FOR WINDOWS CE .NET / POCKET PC
Web Browser Programming Guide Page 45
<br>
Focus starts in first input<br>
<input type=text name="scan1" value="" size=30
onkeypress="myonkey();"><br>
<input type=text name="scan2" value="" size=30
onkeypress="myonkey();"><br>
<input type=text name="scan3" value="" size=30
onkeypress="myonkey();"><br>
<input type=button name="clear" value="Clear Data"
onclick="myclear();" onkeypress="myonkey();">
</center>
</form>
<script for="document" event=onkeypress>
// IMPORTANT: This handler is used when focus is not already
in an input object
myonkey();
</script>
<script language=javascript>
// Handle the key event
function myonkey()
{
if (window.event.keyCode == 9) // look for tab key
{
nextfield( document.activeElement );
window.event.cancelBubble = true;
}
}
// Move from the current field to the next field
function nextfield( current )
{
if (current == document.form1.scan1)
{
document.form1.scan2.focus();
}
else if (current == document.form1.scan2)
{
document.form1.scan3.focus();
}
else
{
document.form1.scan1.focus();
}
}
// Clear the fields
function myclear()
{
document.form1.scan1.value = "";