想实现选择<=1年,月结 >= 60天/<60天 那个radiobutton不可用,选择> 1 年 ,月结 < 60 天 和月结 >= 60天 这两个radiobutton不可用。
以下是我实现的办法 在火狐下面没有问题 但是在ie上只要选择<=1年或者> 1 年的radiobutton下面三个全部不可用,再怎么点击都没有反应了,不知道什么原因 求大师帮忙。
contractApp.aspx
<asp:Content ID="Content1" ContentPlaceHolderID="CPH_Head" runat="Server">
<script type="text/javascript">
function IsEnable() {
$("#ctl00_WFContent2_rdPay1").attr("disabled", true);
$("#ctl00_WFContent2_rdPay2").attr("disabled", true);
$("#ctl00_WFContent2_rdPay3").attr("disabled", false);
if ($("#ctl00_WFContent2_rdPay3")[0].checked) {
$("#ctl00_WFContent2_rdPay3").removeAttr("checked");
}
}
function IsDisEnable() {
$("#ctl00_WFContent2_rdPay1").attr("disabled", false);
$("#ctl00_WFContent2_rdPay2").attr("disabled", false);
$("#ctl00_WFContent2_rdPay3").attr("disabled", true);
if ($("#ctl00_WFContent2_rdPay1")[0].checked) {
$("#ctl00_WFContent2_rdPay1").removeAttr("checked");
}
else if ($("#ctl00_WFContent2_rdPay2")[0].checked) {
$("#ctl00_WFContent2_rdPay2").removeAttr("checked");
}
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="WFContent2" runat="Server">
<asp:RadioButton ID="rdDate1" runat="server" GroupName="GroupCAppDate" Enabled="true" Text="<= 1年" />
<asp:RadioButton ID="rdDate2" runat="server" GroupName="GroupCAppDate" Enabled="true" Text="> 1 年" />
<asp:RadioButton ID="rdPay1" runat="server" GroupName="CAppPay" Enabled="true" Text="月结 < 60 天" />
<asp:RadioButton ID="rdPay2" runat="server" GroupName="CAppPay" Enabled="true" Text="月结 >= 60天" />
<asp:RadioButton ID="rdPay3" runat="server" GroupName="CAppPay" Enabled="true" Text="月结 >= 60天/<60天" />
</asp:Content>contractApp.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
rdDate1.Attributes.Add("onclick", "IsEnable()");
rdDate2.Attributes.Add("onclick", "IsDisEnable()");
}
jqueryradiobutton
以下是我实现的办法 在火狐下面没有问题 但是在ie上只要选择<=1年或者> 1 年的radiobutton下面三个全部不可用,再怎么点击都没有反应了,不知道什么原因 求大师帮忙。
contractApp.aspx
<asp:Content ID="Content1" ContentPlaceHolderID="CPH_Head" runat="Server">
<script type="text/javascript">
function IsEnable() {
$("#ctl00_WFContent2_rdPay1").attr("disabled", true);
$("#ctl00_WFContent2_rdPay2").attr("disabled", true);
$("#ctl00_WFContent2_rdPay3").attr("disabled", false);
if ($("#ctl00_WFContent2_rdPay3")[0].checked) {
$("#ctl00_WFContent2_rdPay3").removeAttr("checked");
}
}
function IsDisEnable() {
$("#ctl00_WFContent2_rdPay1").attr("disabled", false);
$("#ctl00_WFContent2_rdPay2").attr("disabled", false);
$("#ctl00_WFContent2_rdPay3").attr("disabled", true);
if ($("#ctl00_WFContent2_rdPay1")[0].checked) {
$("#ctl00_WFContent2_rdPay1").removeAttr("checked");
}
else if ($("#ctl00_WFContent2_rdPay2")[0].checked) {
$("#ctl00_WFContent2_rdPay2").removeAttr("checked");
}
}
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="WFContent2" runat="Server">
<asp:RadioButton ID="rdDate1" runat="server" GroupName="GroupCAppDate" Enabled="true" Text="<= 1年" />
<asp:RadioButton ID="rdDate2" runat="server" GroupName="GroupCAppDate" Enabled="true" Text="> 1 年" />
<asp:RadioButton ID="rdPay1" runat="server" GroupName="CAppPay" Enabled="true" Text="月结 < 60 天" />
<asp:RadioButton ID="rdPay2" runat="server" GroupName="CAppPay" Enabled="true" Text="月结 >= 60天" />
<asp:RadioButton ID="rdPay3" runat="server" GroupName="CAppPay" Enabled="true" Text="月结 >= 60天/<60天" />
</asp:Content>contractApp.aspx.cs
protected void Page_Load(object sender, EventArgs e)
{
rdDate1.Attributes.Add("onclick", "IsEnable()");
rdDate2.Attributes.Add("onclick", "IsDisEnable()");
}
jqueryradiobutton
解决方案 »
- 怎么判断html生成的rdaio的html控件的是否被选中啊?
- 有的客户端运行程序时,JS画不出线,知道是系统的事,但应该改哪个地方呢?
- 部署到站点上的web.config的配置
- 一个fileup组件。同时上传5个文件非常有趣的实现。
- 异常:[Native Error code: 117] 什么意思???(详见内容)
- 边位兄台!!!有没有好的网页脚本教程....分分分分分..
- 存储过程的问题
- 请思归、快乐王子等高手帮我看看这个js文件。急!
- 问一个老问题 望大家帮忙!
- 如何限制File Field中文件选择框的文件类型??
- webservice 上传多个文件后 分解并保存的问题
- 动态添加用户控件,用户控件是类似省市县三级选择的控件,求帮忙,求办法
<title></title>
<script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
<script type="text/javascript">
$(function () {
$("input[id$=rdDate1]").bind('click', function () {
$("input[id*=rdPay]").removeAttr("checked").attr('disabled', false);
$("input[id$=rdPay3]").attr('disabled', true);
})
$("input[id$=rdDate2]").bind('click', function () {
$("input[id*=rdPay]").removeAttr("checked").attr('disabled', false);
$("input[id$=rdPay1]").attr('disabled', true);
$("input[id$=rdPay2]").attr('disabled', true);
})
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td>
<asp:RadioButton ID="rdDate1" runat="server" GroupName="GroupCAppDate" Enabled="true"
Text="<= 1年" />
<asp:RadioButton ID="rdDate2" runat="server" GroupName="GroupCAppDate" Enabled="true"
Text="> 1 年" />
</td>
</tr>
<tr>
<td>
<asp:RadioButton ID="rdPay1" runat="server" GroupName="CAppPay" Enabled="true" Text="月结 < 60 天" />
<asp:RadioButton ID="rdPay2" runat="server" GroupName="CAppPay" Enabled="true" Text="月结 >= 60天" />
<asp:RadioButton ID="rdPay3" runat="server" GroupName="CAppPay" Enabled="true" Text="月结 >= 60天/<60天" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
<script type="text/javascript">
$(function () {
$("#<%=rdDate1.ClientID %>").bind('click',IsEnable);
$("#<%=rdDate2.ClientID %>").bind('click',IsDisEnable);
}); function aaa() {
alert("sss");
}
function IsEnable() {
$("#<%=rdPay1.ClientID %>").attr("disabled", true);
$("#<%=rdPay2.ClientID %>").attr("disabled", true);
$("#<%=rdPay3.ClientID %>").attr("disabled", false);
if ($("#<%=rdPay3.ClientID %>")[0].checked) {
$("#<%=rdPay3.ClientID %>").removeAttr("checked");
}
}
function IsDisEnable() {
$("#<%=rdPay1.ClientID %>").attr("disabled", false);
$("#<%=rdPay2.ClientID %>").attr("disabled", false);
$("#<%=rdPay3.ClientID %>").attr("disabled", true);
if ($("#<%=rdPay1.ClientID %>")[0].checked) {
$("#<%=rdPay1.ClientID %>").removeAttr("checked");
}
else if ($("#<%=rdPay2.ClientID %>")[0].checked) {
$("#<%=rdPay2.ClientID %>").removeAttr("checked");
}
}
</script>
<asp:RadioButton ID="rdDate1" runat="server" GroupName="GroupCAppDate" Enabled="true"
Text="<= 1年" />
<asp:RadioButton ID="rdDate2" runat="server" GroupName="GroupCAppDate" Enabled="true"
Text="> 1 年" />
<asp:RadioButton ID="rdPay1" runat="server" GroupName="CAppPay" Enabled="true" Text="月结 < 60 天" />
<asp:RadioButton ID="rdPay2" runat="server" GroupName="CAppPay" Enabled="true" Text="月结 >= 60天" />
<asp:RadioButton ID="rdPay3" runat="server" GroupName="CAppPay" Enabled="true" Text="月结 >= 60天/<60天" />