表单验证并在旁边提示的JS代码

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

<script language="javascript">
    function judge(x){
        if(x=="n"){
            var n=document.getElementById("name").value;
            if(n==""){
                document.getElementById("put").innerHTML="提示信息:<span style='colo=#F00'>请填写您的姓名!</span>";
                document.getElementById("tj").disabled=true;
                }
                else{
                document.getElementById("put").innerHTML="";
                document.getElementById("tj").disabled=false;
                    }
            }
        else if(x=="p"){
                var p=document.getElementById("phone").value;
                if(p==""){
                document.getElementById("put").innerHTML="提示信息:<span style='colo=#F00'>请填写您的手机号码!</span>";
                document.getElementById("tj").disabled=true;
                }
                else if(p.length!=11){
                document.getElementById("put").innerHTML="提示信息:<span style='colo=#F00'>请填您正确的联系方式,以便我们联系您!</span>";
                document.getElementById("tj").disabled=true;
                    }
                else{
                document.getElementById("put").innerHTML="";
                document.getElementById("tj").disabled=false;
                    }
                    }
        else if(x=="q"){
                var q=document.getElementById("qq").value;
                if(q==""){
                    document.getElementById("put").innerHTML="提示信息:<span style='colo=#F00'>请填写您的常用qq!</span>";
                    document.getElementById("tj").disabled=true;
                    }
                    else if(isNaN(q)){
                    document.getElementById("put").innerHTML="提示信息:<span style='colo=#F00'>请填写您正确的常用qq,以便我们联系您!</span>";
                    document.getElementById("tj").disabled=true;
                        }
                    else{
                    document.getElementById("put").innerHTML="";
                    document.getElementById("tj").disabled=false;
                        }
                 
                    }
        }
</script>
<form method="post" action="" >
            姓名:<input id="name" type="text" name="name"  onblur="judge('n');"/>
            手机:<input name="phone"  id="phone" type="text" size="15" onblur="judge('p');" />
           常用QQ:<input name="qq" id="qq" type="text" size="15" onblur="judge('q')"/>
        <input type="radio" name="way" value="接收手机短息"  checked="true" /><input type="radio" name="way" value="邮寄邀请函"  />
        留言:<textarea name="msg"></textarea>
        <input type="submit" id="tj" onclick="judge('n')"  class="action" value=""/>
        </form>
        <p id="put"></p>