0
<?php
<input type='text' name='contact_number[$id]' id='contact_number'>
?>
其中,我發佈多個聯繫人數組中。我想在聯繫人中添加jquery驗證,並且它必須是真實的。但它不起作用。如何在多個字段上使用jquery驗證?
我jQuery代碼是:
$("#editUserForm").validate({
rules: {
"contact_number": {
required: true,
minlength: 10,
maxlength: 10,
number: true
}
},
messages: {
}
});
是相同還是輸入名稱相同 – whoami
輸入名稱相同,並且將具有不同的ID。即多輸入。 – kohinoor