<html>
<head>
<script src="__ROOT__/Public/js/jquery-1.11.2.min.js"></script>
</head>
<body>
<div> 账号:<input type="text" name="num" id="uid"></div>
<div id="ts"></div>
</body>
</html>
function zhuce()
{
$this->show();
}
<script type="text/javascript">
$("#uid").blur(function(){
var num = $(this).val();
$.ajax({
url:"__CONTROLLER__/chuli",
data:{num:num},
type:"POST",
dataType:"TEXT",
success:function(data)
{
if(data.trim()=="1")
{
$("#ts").html("此账号已经存在");
}
else
{
$("#ts").html("此账号可用");
}
}
})
})
</script>
function chuli()
{
$n=D("login");
$num=$_POST["num"];
$aa=$n->where("num='{$num}'")->count();
$this->ajaxReturn($aa,"eval");
}
<html>
<head>
<script src="__ROOT__/Public/js/jquery-1.11.2.min.js"></script>
</head>
<body>
<div>
代号:<input type="text" id="code"/>
<span id="ts"></span>
</div>
</body>
</html>
<script type="text/javascript">
$("#code").blur(function(){
var code=$(this).val();
if(code.trim()=="")
{
$("#ts).html("代号不能为空");
}
else
{
$("#ts").html("验证通过");
}
})
</script>
<script type="text/javascript">
$("#code").blur(function(){
var code=$(this).val();
$.ajax({
url:"__CONTROLLER__/yanzheng",
data:{code:code},//第一个code必须是和表中的一致
type:"POST",
dataType:"TEXT",
success:function(data)
{
if(data.trim()=="1")
{
$("#ts").html("验证通过"),
}
else
{
$("#ts").html("此处不能为空"),
}
}
})
})
</script>
function yanzheng()
{
$n=D("nation");
$a=array(
array("code","require","此处不能为空"))
if($n->validate($a)->create())
{
$this->ajaxReturn("1","eval");
}
else
{
$this->ajaxReturn($n->getError(),"eval")
}
}
<div><input type="text" id="email"/><span id="aa"></span></div>
<script type="text/javascript">
$("#email").blur(function(){
var email = $(this).val();
$zz=/^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+((\.[a-zA-Z0-9_-]{2,3}){1,2})$/;
if(email.match($zz)==null)
{
$("#aa").html("邮箱格式不正确");
}
else
{
$("#aa").html("邮箱验证成功");
}
})
</script>
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有