解决方案 »

  1.   


    function nicheng() {
            var n = document.myform.nametext.value;
            var x = document.getElementById("divname");
            if (n.length == 0) {
                x.innerHTML = "<font color='red'>用户名不能为空</font>";
                var txt1 = document.getElementById('nametext');//用户名input加个ID=“nametext”
                txt1.value = "";
                txt1.focus();            return false;
            }
            else {
                x.innerHTML = "";
                
            }
            return true;
        }
    该了个用户名的 其他都一样