我正在做一個複雜的註冊表單。我做了很多Jquery.validation,並且除了在一個表單元素之外完美工作。該表單元素是input = text。它在開始時被禁用,如果選擇了一個單選按鈕,它將被啓用。因此,我的驗證系統按預期工作,除了此輸入。Jquery無法驗證啓用的表格
下面是HTML代碼...
<form class="form_third">
<div id="div_muayenehane" style="display:none">
<div>Telefon <span id="Span13" style="font-size:11px;color:red"></div><div style="line-height: 3px"> </div>
<div><input type="text" id="txt_telefon" name="txt_telefon" style="width: 200px" class="blue_input required" minlength="11" maxlength="11" placeholder="02125556677"; /></div><div style="line-height: 6px">
</div>
</div>
</form>
這裏是jQuery代碼...
$("#form_third").validate({
submitHandler: function() {
return false;
},
errorPlacement: function (error, element) {
error.appendTo(element.parent().prev().prev().children('span'));
},
rules: {
txt_telefon: {
required: true,
digits: true
}
}
});
應該驗證txt_telefon並顯示Span13錯誤信息,但它不工作。它什麼都不做。你以爲,因爲div_muayenehane是在負載禁用
非常感謝你,它的工作。我會將它標記爲5分鐘內回答 – 2013-03-06 08:16:27