安卓手机软键盘输入法,input输入框时,键盘的完成为前进,即刷新了当前页面,解决方法:
换textarea标签
< textarea class=“booking-remark” rows=“1” ></textarea onkeydown="checkEnter(event)">
function checkEnter(event){
var et=e||window.event;
var keycode=et.charCode||et.keyCode;
if(keycode==13){
if(window.event){
window.event.returnValue = false;
}else{
e.preventDefault();//for firefox
}
}
};
}
.booking-remark{
font-size: 1em;
border: 0;
100%;
height: 20px;
line-height: 20px;
color: #333;
font-family: "Microsoft Yahei";
white-space:nowrap;
overflow-x:hidden;
overflow-y:hidden;
}
这样键盘就不会出现前进键