前台:<asp:RadioButton ID="rbtSuggestMRB" runat="server" Enabled="false" Height="20px"
Text="MRB" GroupName="Succ" />
js文件:$(document).ready(function () {
alert("aaa");
$("FrSearchRepair_rbtSuggestMRB").change(function () {
alert("Option changed!");
});
}); 现在执行到alert后面就不在执行了,代码那里有错误嘛,求解答~~
Text="MRB" GroupName="Succ" />
js文件:$(document).ready(function () {
alert("aaa");
$("FrSearchRepair_rbtSuggestMRB").change(function () {
alert("Option changed!");
});
}); 现在执行到alert后面就不在执行了,代码那里有错误嘛,求解答~~
这个控件在那里??
有吗??
你肯定他的页面ID就是这样的吗??
Text="MRB" GroupName="Succ" />加上:ClientID="FrSearchRepair_rbtSuggestMRB"再试试看
不用写<javascript></javascript>标签内 $("#标签")ID是获得该控件,对其进行选择器
<asp:RadioButtonList ID="RadioButtonList1" CssClass="rblSex" runat="server">
<asp:ListItem Value="M" Text="男"></asp:ListItem>
<asp:ListItem Value="W" Text="女"></asp:ListItem>
</asp:RadioButtonList>--------------------------------JQ-----------------
function ChooseSex()
{
var boolSelect=$("input[name=RadioButtonList1]:checked").val();
if(boolSelect)
{
alert("您选择的是:"+boolSelect);
return true;
}
else
{
alert("请选择性别!");
return false;
}
}
w3c radio是没有change事件的 。
参考