1、保证输入框中只能输入数字:οnkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')"
http://www.cnblogs.com/futao/archive/2012/02/08/2342313.html
2、表单提交后在新页面中打开:$("#frm").target = "ftuo"; $("#frm").submit();
3、对页面的回车时间进行监听,进行自己想要的操作:
document.οnkeydοwn=keyDownSearch;
function keyDownSearch(e) {
// 兼容FF和IE和Opera
var theEvent = e || window.event;
var code = theEvent.keyCode || theEvent.which || theEvent.charCode;
if (code == 13) {
getTableListData();//具体处理函数
return false;
}
return true;
}
如果只是针对某个DIV层应用回车查询的话,可以将:
document.οnkeydοwn=keyDownSearch;
改成:
document.getElementById('层ID').οnkeydοwn=keyDownSearch;
keycode减值表:http://www.phpweblog.net/kiyone/archive/2007/04/19/1138.html