尝试找到选中的单选按钮“否”旁边的文本框的值,但失败了。
$("form input:radio[value=False]:checked").closest(".txt").first().val();
html代码如下:
<span id="RadioButtonList1" style="display:inline-block;width:100px;">
<input id="RadioButtonList1_0" type="radio" name="RadioButtonList1" value="true" />
<label for="RadioButtonList1_0">Yes</label>
<input id="RadioButtonList1_1" type="radio" name="RadioButtonList1" **value="False" checked="checked"** />
<label for="RadioButtonList1_1">No</label>
</span>
<span id="RequiredFieldValidator1" style="visibility:hidden;">*</span>
<input name="TextBox1" type="text" value="pp" id="TextBox1" Class="txt" />
<br />
<span id="RadioButtonList2" style="display:inline-block;width:100px;">
<input id="RadioButtonList2_0" type="radio" name="RadioButtonList2" value="true" checked="checked" />
<label for="RadioButtonList2_0">Yes</label>
<input id="RadioButtonList2_1" type="radio" name="RadioButtonList2" value="False" />
<label for="RadioButtonList2_1">No</label>
</span>
<span id="RequiredFieldValidator2" style="visibility:hidden;">*</span>
<input name="TextBox2" type="text" id="TextBox2" Class="txt" />
<br />
<span id="RadioButtonList3" style="display:inline-block;width:100px;">
<input id="RadioButtonList3_0" type="radio" name="RadioButtonList3" value="true" checked="checked" />
<label for="RadioButtonList3_0">Yes</label>
<input id="RadioButtonList3_1" type="radio" name="RadioButtonList3" value="False" />
<label for="RadioButtonList3_1">No</label>
</span>
<span id="RequiredFieldValidator3" style="visibility:hidden;">*</span>
<input name="TextBox3" type="text" id="TextBox3" Class="txt" /><br />