javascript 达到设置textbox的"enable=false"状态一样的功能
Posted on 2009-02-06 11:50 hyd309 阅读(1323) 评论(0) 编辑 收藏 举报
RadioButton cc = new RadioButton();
RadioButton dd = new RadioButton();
aa.ID = "Tbx_aa";
aa.Text = "aaaaaaa";
bb.ID = "Tbx_bb";
PlaceHolder1.Controls.Add(aa);
PlaceHolder1.Controls.Add(bb);
cc.ID = "Cbx_cc";
cc.Text = "有效";
cc.GroupName = "1";
cc.Attributes.Add("onclick", "javascript:document.getElementById('Tbx_aa').disabled=false;document.getElementById('Tbx_bb').disabled=false;");
PlaceHolder1.Controls.Add(cc);
dd.ID = "Cbx_dd";
dd.Text = "无效";
dd.Checked = true;
dd.GroupName = "1";
dd.Attributes.Add("onclick", "javascript:document.getElementById('Tbx_aa').disabled=true;document.getElementById('Tbx_bb').disabled=true;");
PlaceHolder1.Controls.Add(dd);
RadioButton dd = new RadioButton();
aa.ID = "Tbx_aa";
aa.Text = "aaaaaaa";
bb.ID = "Tbx_bb";
PlaceHolder1.Controls.Add(aa);
PlaceHolder1.Controls.Add(bb);
cc.ID = "Cbx_cc";
cc.Text = "有效";
cc.GroupName = "1";
cc.Attributes.Add("onclick", "javascript:document.getElementById('Tbx_aa').disabled=false;document.getElementById('Tbx_bb').disabled=false;");
PlaceHolder1.Controls.Add(cc);
dd.ID = "Cbx_dd";
dd.Text = "无效";
dd.Checked = true;
dd.GroupName = "1";
dd.Attributes.Add("onclick", "javascript:document.getElementById('Tbx_aa').disabled=true;document.getElementById('Tbx_bb').disabled=true;");
PlaceHolder1.Controls.Add(dd);