zoukankan      html  css  js  c++  java
  • (网页)习惯了CS回车操作人员,操作BS网页表单也是回车666

    1.第一步把表单,里面需要回车的input,或者是其他的表单按钮给一个clsss,例如下面的$('.cls');

    2.第二步,  把下面的代码复制过去,填写完最后一个自动提交:$("#savedown").click();

    3.选中input的框的时候一定要全部选中,不然操作会不方便,给一个提示

    ----------------------------------------------------------------------------------------------------------------------------------------

    $("input").focus(function() {
                            this.select();
                        });   

    -----------------------------------------------------------------------------------------------------------------------------------------

    <input style="208px;" id="onlyshipid" class="form-control cls" type="text" onblur="clearorchangeNum()">

    <input style="208px;" id="onlyshipid" class="form-control cls" type="text" onblur="clearorchangeNum()">

    $(function(){
                        $("input").focus(function() {
                            this.select();
                        });    
                        $('#goodsnameid').focus();
                        var $inp = $('.cls');
                        $inp.bind('keydown', function (e) {
                        var key = e.which;
                        if (key == 13) {
                            e.preventDefault();
                            var nxtIdx = $inp.index(this) + 1;                
                            if($('.cls').size() == nxtIdx){
                                $("#savedown").click();
                                $(".cls:eq(" + 0 + ")").focus();
                                $(".cls:eq(" + 0 + ")").select();
                            }else{                        
                                $(".cls:eq(" + nxtIdx + ")").focus();
                                $(".cls:eq(" + nxtIdx + ")").select();
                                
                            }
                        }  
                    });
            });   

  • 相关阅读:
    Web打印控件
    excel错误:外部表不是预期的格式 错误
    C#用ado.net访问EXCEL的常见问题及解决方法
    通过反射的方式获取类型中的所有属性
    在64位Windows7上安装64位Oracle11g
    2020&2021的计划
    jQuery_day1
    springboot+mybatis+MySQL(入门级-半小时搞定系列)
    springboot_web开发
    springboot日志
  • 原文地址:https://www.cnblogs.com/historylyt/p/7214201.html
Copyright © 2011-2022 走看看