谁知道如何获取input标签的radiobutton的选中值?
1个回答
展开全部
02string sqlUnitName = "select unitcode,unitname from ZDT_PROJECTUNIT where companycode=" + Session["Code_ProjectCode"].ToString() + " order by unitcode";
02DataSet DsUnitName = DBUtility.DbHelperSQL.Query(sqlUnitName);
02string str = "";
02rab.InnerHtml = "";
02if (DsUnitName.Tables[0].Rows.Count > 0)02{02for (int i = 0; i < DsUnitName.Tables[0].Rows.Count; i++)02{02if (i == 0)02{02rab.InnerHtml += "<input runat='server' value='" + DsUnitName.Tables[0].Rows[i]["unitcode"].ToString() +"' type='radio' name='rbt' checked='checked'/>" + DsUnitName.Tables[0].Rows[i]["unitname"].ToString();02}02else02{02rab.InnerHtml += "<input runat='server' value='" + DsUnitName.Tables[0].Rows[i]["unitcode"].ToString() +"' type='radio' name='rbt'/>" + DsUnitName.Tables[0].Rows[i]["unitname"].ToString();02}020202}02}02else02{02rab.InnerHtml = "";02}如何才能获取radiobutton选中状态下的值? 求各位路过的高手帮帮忙... C#语言26 次浏览 2011-10-24 23:327 个回答 for(i=0;i<document.getElementsByName("rbt").length;i++) 0202{ 02020202if(document.getElementsByName("rbt")[i].checked)
02HtmlInputRadioButton chb = (HtmlInputRadioButton)this.GridView1.Rows[i].FindControl("CheckBox1");
02if (chb.Checked == true)02{02s = s + chb.Value;02}02else02{02Response.Write("<script>alert('check one?');</script>");02}02} 2011-10-24 23:50 推荐: 0 次 有帮助? 请推荐 已经说的很全了... 2011-10-24 23:52 推荐: 0 次 有帮助? 请推荐引用1 楼 kongwei521 的回复:for(i=0;i<document.getElementsByName("rbt").length;i++) 0202{ 02020202if(document.getElementsByName("rbt")[i].checked)
02DataSet DsUnitName = DBUtility.DbHelperSQL.Query(sqlUnitName);
02string str = "";
02rab.InnerHtml = "";
02if (DsUnitName.Tables[0].Rows.Count > 0)02{02for (int i = 0; i < DsUnitName.Tables[0].Rows.Count; i++)02{02if (i == 0)02{02rab.InnerHtml += "<input runat='server' value='" + DsUnitName.Tables[0].Rows[i]["unitcode"].ToString() +"' type='radio' name='rbt' checked='checked'/>" + DsUnitName.Tables[0].Rows[i]["unitname"].ToString();02}02else02{02rab.InnerHtml += "<input runat='server' value='" + DsUnitName.Tables[0].Rows[i]["unitcode"].ToString() +"' type='radio' name='rbt'/>" + DsUnitName.Tables[0].Rows[i]["unitname"].ToString();02}020202}02}02else02{02rab.InnerHtml = "";02}如何才能获取radiobutton选中状态下的值? 求各位路过的高手帮帮忙... C#语言26 次浏览 2011-10-24 23:327 个回答 for(i=0;i<document.getElementsByName("rbt").length;i++) 0202{ 02020202if(document.getElementsByName("rbt")[i].checked)
02HtmlInputRadioButton chb = (HtmlInputRadioButton)this.GridView1.Rows[i].FindControl("CheckBox1");
02if (chb.Checked == true)02{02s = s + chb.Value;02}02else02{02Response.Write("<script>alert('check one?');</script>");02}02} 2011-10-24 23:50 推荐: 0 次 有帮助? 请推荐 已经说的很全了... 2011-10-24 23:52 推荐: 0 次 有帮助? 请推荐引用1 楼 kongwei521 的回复:for(i=0;i<document.getElementsByName("rbt").length;i++) 0202{ 02020202if(document.getElementsByName("rbt")[i].checked)
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询