var reset=0;
$(".style48 :radio").each(function(){
if($(this).attr("checked")==true)
{
if($(this).val()=="0")
{
alert($(this).next("input:text").val());
}
}
})
if(reset>0)
{
alert("请填写扣分原因..");
return false;
}
-------------------html代码----
<tr>
<td><input id="W1_0" type="radio" name="W1" value="1" checked="checked" /><label for="W1_0">1</label></td><td><input id="W1_1" type="radio" name="W1" value="2" /><label for="W1_1">2</label></td><td><input id="W1_2" type="radio" name="W1" value="3" /><label for="W1_2">3</label></td><td><input id="W1_3" type="radio" name="W1" value="4" /><label for="W1_3">4</label></td><td><input id="W1_4" type="radio" name="W1" value="5" /><label for="W1_4">5</label></td>
</tr><tr>
<td><input id="W1_5" type="radio" name="W1" value="6" /><label for="W1_5">6</label></td><td><input id="W1_6" type="radio" name="W1" value="7" /><label for="W1_6">7</label></td><td><input id="W1_7" type="radio" name="W1" value="8" /><label for="W1_7">8</label></td><td><input id="W1_8" type="radio" name="W1" value="9" /><label for="W1_8">9</label></td><td><input id="W1_9" type="radio" name="W1" value="10" /><label for="W1_9">10</label></td>
</tr>
----------------------------------
alert($(this).next("input:text").val());
得不到对象,怎么解决,为什么?
$(".style48 :radio").each(function(){
if($(this).attr("checked")==true)
{
if($(this).val()=="0")
{
alert($(this).next("input:text").val());
}
}
})
if(reset>0)
{
alert("请填写扣分原因..");
return false;
}
-------------------html代码----
<tr>
<td><input id="W1_0" type="radio" name="W1" value="1" checked="checked" /><label for="W1_0">1</label></td><td><input id="W1_1" type="radio" name="W1" value="2" /><label for="W1_1">2</label></td><td><input id="W1_2" type="radio" name="W1" value="3" /><label for="W1_2">3</label></td><td><input id="W1_3" type="radio" name="W1" value="4" /><label for="W1_3">4</label></td><td><input id="W1_4" type="radio" name="W1" value="5" /><label for="W1_4">5</label></td>
</tr><tr>
<td><input id="W1_5" type="radio" name="W1" value="6" /><label for="W1_5">6</label></td><td><input id="W1_6" type="radio" name="W1" value="7" /><label for="W1_6">7</label></td><td><input id="W1_7" type="radio" name="W1" value="8" /><label for="W1_7">8</label></td><td><input id="W1_8" type="radio" name="W1" value="9" /><label for="W1_8">9</label></td><td><input id="W1_9" type="radio" name="W1" value="10" /><label for="W1_9">10</label></td>
</tr>
----------------------------------
alert($(this).next("input:text").val());
得不到对象,怎么解决,为什么?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货