富贵资源网 Design By www.hznty.com

如下所示:
复制代码 代码如下:
function saomiao(event,n)
{
     var code=0;
     code=event.keyCode;//监听键盘输入事件
     if(code=='13')//如果键盘输入回车键
     {
          if(n>0)//开始判断参数
          {
               if(document.getElementById('logisticsno').value=='')
          {
           alert('请扫描输入运单号!');
                     var r=document.getElementById('logisticsno');
                     r.focus();
           return false;
                   }
             else if(document.activeElement.name!='deliver_money')//document.activeElement.name焦点所在的元素名
             {
                     var r=document.getElementById('deliver_money');
                     r.focus();       
               }
             else//如果所有条件都满足
             {
                 var r=document.getElementById('logisticsno');
                     r.focus();
                     var f=document.createElement('form');//开始新建表单
                     f.action='/modules/logistics/start.php';
                     document.body.appendChild(f);//添加至body

                     var e=document.createElement('input');//新建表单元素
                     e.type='hidden';
                     e.name='act';
                     e.id='act';
                     e.value='logisticsno';
                     f.appendChild(e);//添加至表单

                     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();//表单提交
                   }  
               }   
      }
     }
<body onKeyPress="javascript:saomiao(event,555);">//开始监控键盘输入
 

富贵资源网 Design By www.hznty.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!
富贵资源网 Design By www.hznty.com