<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>忘记密码</title>
<link rel="stylesheet" type="text/css" href="../css/background.css" />
<link rel="stylesheet" type="text/css" href="../css/cell_reg.css" />
<script src="../js/jquery.min.js" type="text/javascript"></script>
</head>
<script language="javascript">
$(function(){
$("#cardid").blur(function(){//用户名文本框失去焦点触发验证事件
if($(this).val =null || !$(this).val.match(/^\d{18}$/))//验证不能为空并且18位数字
{s
$("#nameTip").html("卡号不能为空或只能为18位数字");
}
else
{
$("#nameTip").html("输入正确");
}
});
<tr align="center">
<td class="tdsty1" >卡 号:<td>
<td class="tdsty2" ><input type="text" name="cardid" id="cardid" /><span id="nameTip"></span></td>
</tr>
<title>忘记密码</title>
<link rel="stylesheet" type="text/css" href="../css/background.css" />
<link rel="stylesheet" type="text/css" href="../css/cell_reg.css" />
<script src="../js/jquery.min.js" type="text/javascript"></script>
</head>
<script language="javascript">
$(function(){
$("#cardid").blur(function(){//用户名文本框失去焦点触发验证事件
if($(this).val =null || !$(this).val.match(/^\d{18}$/))//验证不能为空并且18位数字
{s
$("#nameTip").html("卡号不能为空或只能为18位数字");
}
else
{
$("#nameTip").html("输入正确");
}
});
<tr align="center">
<td class="tdsty1" >卡 号:<td>
<td class="tdsty2" ><input type="text" name="cardid" id="cardid" /><span id="nameTip"></span></td>
</tr>
if($(this).val==null || !$(this).val.match(/^\d{18}$/))//验证不能为空并且18位数字
例如 width(), height() ,offset().left
$("#nameTip").html("卡号不能为空或只能为18位数字");大哥 。。你这s是想肿么了,想干什么ctrl+s的时候注意点
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<script type="text/javascript" src="jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$("#cardid").blur(function(){
var val=$(this).val();
// alert(val);
if(val.length==0||val.length!=19){
alert("The text is wrong!");
}else{
alert("OK");
}
});
});</script>
<body>
<!--<embed width="100%" height="100%" name="plugin" src="C:\Users\MKW\Desktop\Oracle Concepts (10g R2) 中文版.pdf" type="application/pdf">-->
<input type="text" id="cardid"/>
</body>
</html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>忘记密码</title>
<link rel="stylesheet" type="text/css" href="../css/background.css" />
<link rel="stylesheet" type="text/css" href="../css/cell_reg.css" />
<script src="../js/jquery.min.js" type="text/javascript"></script>
</head>
<script language="javascript">
$(function(){
$("#cardid").blur(function() //用户名文本框失去焦点触发验证事件
{
if($(this).val() == null || !$(this).val().match(/^\d{18}$/))//验证不能为空并且18位数字
{
$("#nameTip").html("卡号不能为空或只能为18位数字");
}
else
{
$("#nameTip").html("输入正确");
}
});
});
</script>
<body style='width:300px;height:300px;background:gray'>
<table style='width:200px;height:50px;border:1px solid red'>
<tr align="center">
<td class="tdsty1" >卡 号:<td>
<td class="tdsty2" ><input type="text" name="cardid" id="cardid" style='width:100px;height:20px'/><span id="nameTip"></span></td>
</tr>
</table>
</body>
</html>