我正在使用jquery validate插件。我在复选框或单选按钮上重复启用禁用文本框的要求,并且只有在选中时才需要它。你能帮我创建一个通用脚本吗?
<table class="list-table">
<tbody>
<tr>
<td width="50"><input type="radio" name="radio2" id="ownAcc" class="required"/></td>
<td width="200">Own Account</td>
<td class="last"><select class="dropdown" id="ownAccDD"><option>Select</option></select></td>
</tr>
<tr class="alt-row">
<td><input type="radio" name="radio2" /></td>
<td>Registered 3rd Party Account</td>
<td class="last"><select class="dropdown"><option>Select</option></select></td>
</tr>
<tr>
<td><input type="radio" name="radio2" id="unreg" /></td>
<td>Unregistered Account</td>
<td class="last"><input type="text" name="uregacc" class="text-box dependent" />
<span class="hintmsg">
(Enter the 13-digit account number)
</span>
</td>
</tr>
<tr>
<td></td>
<td colspan="2">
<span class="hintmsg"><b>Note:</b>Transaction limit is only applicable for registered and unregistered 3rd party account fund transfer.</span>
</td>
</tr>
</tbody>
</table>
答案 0 :(得分:0)
在这种情况下,您可以在jquery验证插件中添加自定义验证器,该验证器将根据您的要求运行。