function Saomiao (event,n)
{
var code=0;
code=event.keycode;//listening for keyboard input events
if (code== ' 13 ')//If the keyboard enters the ENTER key
{
if (n>0)//Start judging parameters
{
if (document.getElementById (' Logisticsno '). value== ')
{
Alert (' Please scan input waybill number! ');
var R=document.getelementbyid (' Logisticsno ');
R.focus ();
return false;
}
else if (document.activeelement.name!= ' Deliver_money ')//document.activeelement.name the element name where the focus is
{
var R=document.getelementbyid (' Deliver_money ');
R.focus ();
}
else//if all the conditions are met
{
var R=document.getelementbyid (' Logisticsno ');
R.focus ();
var f=document.createelement (' form ');/Start new Form
f.action= '/modules/logistics/start.php ';
Document.body.appendChild (f);//Add to Body
var e=document.createelement (' input ');//New FORM element
E.type= ' hidden ';
E.name= ' act ';
e.id= ' act ';
E.value= ' Logisticsno ';
F.appendchild (e);//Add to form
var data_id=0;
var g=document.getelementsbyname ("orderdataid_no[]");
var h=0;
for (Var h=0;h<g.length;h++)
{
Data_id=g[h].value;
}
var order_no=0;
var gg=document.getelementsbyname ("order_no[]");
var hh=0;
for (Var hh=0;hh<gg.length;hh++)
{
Order_no=gg[hh].value;
}
var k=document.createelement (' input ');
K.type= ' hidden ';
K.name= ' Order_no ';
K.id= ' Order_no ';
K.value=order_no;
F.appendchild (k);
F.submit ()//form submission
}
}
}
}
<body onkeypress= "Javascript:saomiao (event,555);" >//starts monitoring keyboard input