Ajax验证表单,追加100-500

来源:百度知道 编辑:UC知道 时间:2024/05/06 02:25:53
代码如下
function chk_sn()
{

if (document.getElementById('input_sn').value=="")
{
document.getElementById('sn_text').innerHTML="<font color=#FF0000><span class='x'>*</span>请您输入奇山卡片上的18位密码</font>";
}
else
{
check=window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest();
check.onreadystatechange=ck_sn;
var sn=document.getElementById('input_sn').value;
var url="check_sn.php?sn="+sn;
check.open("GET",url,true);
check.send(null);
}
}

function check_sn_a(check)
{
if(check.readyState==4)
{
if(check.status==200)
{
var t=check.responseText;
if(t=="false")
{
document.getElementById('sn_text').innerHTML="<font color=#FF0000><span class='x'>*</span&

function check_sn_a(check)
{
if(check.readyState!=4 && check.status!=200)
return false ;

var t=check.responseText;
if(t=="false")
{
document.getElementById('sn_text').innerHTML="<font color=#FF0000><span class='x'>*</span>宝箱密码不存在或者已经失效</font>";
return false;
}
else
{
document.getElementById('sn_text').innerHTML="<font color=#a2ce3a> 输入正确</font>";
return true;
}

}

function chk_sn()
{

if (document.getElementById('input_sn').value=="")
{
document.getElementById('sn_text').innerHTML="<font color=#FF0000><span class='x'>*</span>请您输入奇山卡片上的18位密码</font>";
return false ;
}
else
{
check=window.ActiveXObject ? new ActiveXObject("Microsoft.XMLHTTP"):new XMLH