ラジオ2で有効になっている場合、テキストボックスBのフォーム送信中に入力を検証したいのですが、テキストボックスBの入力検証が以下のコードで機能していません。
<script type="text/javascript">
$(document).ready(function()
{
$("#form").validate(
{
rules: {B: "required",}
});
$(':radio').change(function()
{
$('#B').prop('disabled', !(this.value == '2' && this.checked));
});
});
</script>
<form id="form" name="form" method="post" action="">
<table><tr>
<td width><input type="radio" name="A" id="1" value="1" />1</td>
<td width><input type="radio" name="A" id="2" value="2" />2</td>
</tr></table>
<input name="B" type="text" id="B" disabled="disabled"/>
<input type="submit" name="form" id="Submit" value="Submit" />
</form>