复制代码 代码如下:

<!DOCTYPE html>
<html>
    <head>
        <meta charset=”UTF-8″>
        <title>Test</title>
        <script type=”text/javascript”
src=”jQuery/jquery-1.5.2.js”></script>
    </head>
金沙糖果派对网站app,    <script type=”text/javascript”>
        $(document).ready(function() {
            //敲击开关时触及
            $(“#Score”).bind(“keypress”, function(event) {
                var getValue = $(this).val();
金沙糖果派对2015cc,                //调整第多个不可能输入小数点”.”
                if (getValue.length == 0 && event.which == 46) {
                    event.preventDefault();
                    return;
                }
                //调节只能输入叁个小数点”.”
                if (getValue.indexOf(‘.’) != -1 && event.which == 46)
{
                    event.preventDefault();
                    return;
                }
                //调控只好输入的值
                if (event.which && (event.which < 48 || event.which
> 57) && event.which != 8 && event.which != 46) {
                    event.preventDefault();
                    return;
                }
            })
            //失去宗旨是接触
            $(“#Score”).bind(“blur”, function(event) {
                var value = $(this).val(), reg = /\.$/;
                if (reg.test(value)) {
                    value = value.replace(reg, “”);
                    $(this).val(value);
                }
            })
        });
    </script>
    <body>
        <input type=”text” id=”Score” />
    </body>
</html>

<form name=”form1″ method=”post” action=”enter.asp” onsubmit=”return checkform();”>

<script language = “javascript” type = “text/javascript”>
function check(event){
//用户每按下二个键,就去看清是或不是三个数
if(event.keyCode<48 || event.keyCode>57){
window.alert(“你输入的不是数字!”);
return false;
}
}
</script>
<body>
<input type = “text” onkeypress = “return check(event)”/>
</body>

代码如下: !DOCTYPE html html head meta
charset=”UTF-8″ titleTest/title script type=”text/javascript”
src=”jQuery/jquery-1.5.2.js”/script /head script type=”text/ja…

3.限制输入框只可以输入数字金额
<input type=text name=txtPostalCode onKeypress=”if (event.keyCode < 45 || event.keyCode > 57) event.returnvalue = false;”>

复制代码 代码如下:

9.限量只可以输入(0~9,a~z)﹕
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=big5″>
    <SCRIPT language=javascript>
<!–
function ischinese(){
var reg=/[^a-z0-9_]/g
if (reg.test(document.form1.text3.value)){
    alert(“请输入0-9和题诗的a-z﹗”);
 form1.text3.focus(); 
return false; 
}else{
return true;}
}
//–>
</SCRIPT>

8. text聚焦
<body text=”#000000″ bgcolor=”#EFF1FD” onload=”document.form1.txm.focus();” scroll=”no”>

2.输入框限制
<input type=”text” name=”txtMonth” value=”” 
    onBlur=”if(this.value<1||this.value>12)
    {alert(‘月份输入有误!’);
    this.focus();}>

admin

相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注