1.只允许输入数字
2.禁止">

几个表单常用的验证脚本

80酷酷网    80kuku.com

  脚本

<input onkeypress="return event.keyCode>=48&&event.keyCode<=57" onpaste="return !clipboardData.getData('text').match(/\D/)" ondragenter="return false">
1.只允许输入数字
2.禁止汉字
3.允许paste,但不破坏clipboard
4.禁止drag
===================================================
 <script language="JavaScript" type="text/JavaScript">
 function HideMenu()
 {
 }
 </script>
<body onmousemove='HideMenu()' oncontextmenu="return false" ondragstart="return false" onselectstart ="return false" onselect="document.selection.empty()" oncopy="document.selection.empty()" onbeforecopy="return false" >
禁止复制选择等................
===================================================
<script language="JavaScript" type="text/JavaScript">
//双击鼠标滚动屏幕的代码
var currentpos,timer;
function initialize()
{
timer=setInterval ("scrollwindow ()",30);
}
function sc()
{
clearInterval(timer);
}
function scrollwindow()
{
currentpos=document.body.scrollTop;
window.scroll(0,++currentpos);
if (currentpos !=document.body.scrollTop)
sc();
}
document.onmousedown=sc
document.ondblclick=initialize
</script>



分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: