Casio Naurtech CETerm Ver.5.1 Web Browser Programming Manual User Manual

Page 45

Advertising
background image

N

AURTECH

W

EB

B

ROWSER

S

MART

C

LIENTS FOR

W

INDOWS

CE .NET / P

OCKET

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 = "";

Advertising