新手求帮助HTML的JQUERY部分 验证信息
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title></title>
<script src="js/jquery.validate.js" type="text/javascript"></script>
<script src="js/jquery-2.0.3.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$("#form1").validate({
rules: {
Text1: "required"
},
messages: {
Text1: "请输入用户名"
}
});
});
</script>
</head>
<body>
<form id="form1" runat="server">
<input id="Text1" type="text" /><br />
<input id="Text2" type="text" /><br />
<input id="Text3" type="text" /><br />
<input type = "submit" value = "提交" />
</form>
</body>
</html>
新手问一下怎么才能 "请输入用户名"提示出来???????????
------解决方案--------------------function wxPhonePwd() {
var phonePwd = $("#txtphonePwd").val();
if (phonePwd.length == 0) {
$("#lblphonePwd").css({ color: "red" });
$("#lblphonePwd").text("请输入密码!");
//alert("请输入密码!");
return false;
} else {