按回车键没反应

WBOY
Release: 2016-06-23 14:08:49
Original
1949 people have browsed it

当单击表单按纽时。php代码起作用,但是按回车键却没反应?


回复讨论(解决方案)

可以专门放个js 来响应回车动作。不过正常情况表单的 onsubmit  不是会响应嘛

下面是copy过来的
  $(document).ready(function(){ 
        $("按下回车的控件").keydown(function(e){ 
            var curKey = e.which; 
            if(curKey == 13){ 
                $("#回车事件按钮控件").click(); 
                return false; 
            } 
        }); 
    }); 

这种情况,要么客户端用了js判断,要么服务器端的关键判断都针对submit按钮的值作判断

回车提交是不带submit按钮的值的

作用的焦点是文本框还是document ?给目标元素添加onkeydown 事件就可以了。

这种情况,要么客户端用了js判断,要么服务器端的关键判断都针对submit按钮的值作判断

回车提交是不带submit按钮的值的 ++

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template