我使用jQuery驗證,當我提交表單時,它只顯示一個必填字段,並且只在我點擊它們時顯示其他人,以及下一個。jQuery的奇怪行爲驗證
這是劇本和身體:
jQuery(function() {
$("#form1").validate({
rules: {
Yritys: {
required: true,
minlength: 3
},
Henkilönimi: {
required: true,
minlength: 3
},
Asema_yrityksessa: {
required: true,
minlength: 3
},
Puhelin_Nr: {
required: true,
minlength: 3
},
e_Mail: {
required: true,
minlength: 3
},
Keskustelun_aihe: {
required: true,
minlength: 10
},
messages: {
Yritys: {
required: "You must enter something",
minlength: "You must enter more than 3 characters"
},
Henkilönimi: {
required: "You must enter something",
minlength: "You must enter more than 3 characters"
},
Asema_yrityksessa: {
required: "You must enter something",
minlength: "You must enter more than 3 characters"
},
Puhelin_Nr: {
required: "You must enter something",
minlength: "You must enter more than 3 characters"
},
e_Mail: {
required: "You must enter something",
minlength: "You must enter more than 3 characters"
},
Keskustelun_aihe: {
required: "You must enter something",
minlength: "You must enter more than 10 characters"
}
}
},
});
});
<div class="divInfo">
<form id="form1">
<span>Yritys:</span><br />
<input id="Yritys" type="text" required /><br />
<span>Henkilönimi:</span><br />
<input id="Henkilönimi" type="text" required /><br />
<span>Asema yrityksessa:</span><br />
<input id="Asema_yrityksessa" type="text" required /><br />
<span>Puhelin Nr:</span><br />
<input id="Puhelin_Nr" type="text" required /><br />
<span>e-Mail:</span><br />
<input id="e_Mail" type="text" required /><br />
<span>Keskustelun aihe:</span><br />
<textarea id="Keskustelun_aihe" maxlength="140" style="width:300px;height:150px;" required>Enter Text Here...</textarea><br />
<span style="color:red; margin-left:0;">Keskustelun aihe max 140 merkkia</span>
<div id="textarea_feedback" style="opacity:0.5"></div>
<div class="butt"><pre style="font-size:x-large">Vahvista varaus klikkamalla tässä>>>>>>>>>>>>><button id="submit" type="submit" name="appointment" value="" class="btn-warning" /></pre></div>
</form>
</div>
爲什麼會出現這種情況?它可以工作,但不能正常工作。我找不到解決方案。
編輯:
發生這種情況:
* 「跆拳道是怎麼回事」 *〜請不要因此使用咒罵語,縮略語,文字說話,還是什麼,但正確的英語語法。編輯。謝謝。 – Sparky
對不起,我陷入了困境 – MicroDev