第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定

想不通,我和老師代碼一樣的,為什么不能出現(xiàn)提示信息

<!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>
<meta?http-equiv="Content-Type"?content="text/html;?charset=gb2312"?/>
<title>無標(biāo)題文檔</title>
<link?href="type.css"?rel="stylesheet"?type="text/css">
<script??src="vendor/jquery.validate-1.13.1.js"?type="text/javascript"></script>
<script?src="vendor/jquery-1.10.0.js"?type="text/javascript"></script>
</head>
<body>
<form?id="demoForm"?method='post'>
<fieldset>
<legend>用戶登錄</legend>
<p>
<label?for="username">用戶名</label>
<input?type="text"?id="username"?name="username">
</p>
<p>
<label?for="password">密碼</label>
<input?type="password"?id="password"?name="password">
</p>
<p>
<input?type="submit"?value="登錄">
</p>
</fieldset>
</form>


<script?type="text/javascript">
$(document).ready(function(){
$("#demoForm").validate({
rules:?{
username:{
required:true,
minlength:2,
maxlength:10
},
password:{
required:true,
minlength:2,
maxlength:16
}
}
messages:?{
username:{
required:"用戶名必須填寫",
minlength:"用戶名最少為2字符",
maxlength:"用戶名最大為10字符"
},
password:{
required:"密碼必須填寫",
minlength:"密碼最少為2字符",
maxlength:"密碼最大為16字符"
}
}
});
});
</script>
</body>
</html>

為什么我不能產(chǎn)生提示信息呢

CSS樣式表

body {

? ? font-size: 36px;

? ? line-height: 1.6;

}



p {

? ? margin: 10px 0;

}



label {

? ? display: inline-block;

? ? min-width: 140px;

}



label.error {

? ? margin-left: 10px;

? ? color: red;

}



input, button {

? ? font-size: 36px;

? ? line-height: 35px;

? ? border: 1px solid #999;

? ? min-width: 180px;

}



input.error {

? ? border: 1px solid red;

}



input[type=submit], button {

? ? margin-top: 20px;

? ? font-size: 36px;

? ? padding: 10px 0;

}

/* CSS Document */




正在回答

1 回答

<!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>
????<meta?http-equiv="Content-Type"?content="text/html;?charset=gb2312"?/>
????<title>無標(biāo)題文檔</title>
????<style>
????????body?{
????????????font-size:?36px;
????????????line-height:?1.6;
????????}


????????p?{
????????????margin:?10px?0;
????????}


????????label?{
????????????display:?inline-block;
????????????min-width:?140px;
????????}


????????label.error?{
????????????margin-left:?10px;
????????????color:?red;
????????}


????????input,?button?{
????????????font-size:?36px;
????????????line-height:?35px;
????????????border:?1px?solid?#999;
????????????min-width:?180px;
????????}


????????input.error?{
????????????border:?1px?solid?red;
????????}


????????input[type=submit],?button?{
????????????margin-top:?20px;
????????????font-size:?36px;
????????????padding:?10px?0;
????????}
????</style>
????<script?src="http://cdn.bootcss.com/jquery/1.10.0/jquery.js"></script>
????<script??src="http://cdn.bootcss.com/jquery-validate/1.13.1/jquery.validate.js"?type="text/javascript"></script>
</head>
<body>
<form?id="demoForm"?method='post'>
????<fieldset>
????????<legend>用戶登錄</legend>
????????<p>
????????????<label?for="username">用戶名</label>
????????????<input?type="text"?id="username"?name="username">
????????</p>
????????<p>
????????????<label?for="password">密碼</label>
????????????<input?type="password"?id="password"?name="password">
????????</p>
????????<p>
????????????<input?type="submit"?value="登錄">
????????</p>
????</fieldset>
</form>


<script?type="text/javascript">
????$(document).ready(function(){
????????$("#demoForm").validate({
????????????rules:?{
????????????????username:{
????????????????????required:true,
????????????????????minlength:2,
????????????????????maxlength:10
????????????????},
????????????????password:{
????????????????????required:true,
????????????????????minlength:2,
????????????????????maxlength:16
????????????????}
????????????},
????????????messages:?{
????????????????username:{
????????????????????required:"用戶名必須填寫",
????????????????????minlength:"用戶名最少為2字符",
????????????????????maxlength:"用戶名最大為10字符"
????????????????},
????????????????password:{
????????????????????required:"密碼必須填寫",
????????????????????minlength:"密碼最少為2字符",
????????????????????maxlength:"密碼最大為16字符"
????????????????}
????????????}
????????});
????});
</script>
</body>
</html>

兩個問題,1 應(yīng)該先旨入jquery文件 后引入jquery-validate文件,因為jquery-validate對jquery有依賴。

2.第85(我的代碼85行)行少一個,

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

李曉健

不是85行 是87行
2015-11-07 回復(fù) 有任何疑惑可以回復(fù)我~
#2

sunfeisunfei 提問者 回復(fù) 李曉健

萬分感謝,可以運行了,可是我不懂為什么要有這個先后順序呢
2015-11-13 回復(fù) 有任何疑惑可以回復(fù)我~
#3

qq_yEs先生_53591812

大神,問下validate函數(shù)里面為什么都用逗號來分隔?。坎皇嵌加梅痔枂??
2016-09-13 回復(fù) 有任何疑惑可以回復(fù)我~
#4

李曉健 回復(fù) qq_yEs先生_53591812

里面是一個對象呀,對象的不同屬性,不就是逗號分隔
2016-09-13 回復(fù) 有任何疑惑可以回復(fù)我~
#5

qq_yEs先生_53591812 回復(fù) 李曉健

謝謝 明白了
2016-09-13 回復(fù) 有任何疑惑可以回復(fù)我~
查看2條回復(fù)

舉報

0/150
提交
取消

想不通,我和老師代碼一樣的,為什么不能出現(xiàn)提示信息

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號