<form action="Diaocha.aspx" method="post" name="form_<%#Eval("classid")%>" id="form_<%#Eval("classid")%>" onsubmit="return checkvote(this);">
<input name="P_Id" type="checkbox" value="1"/>投票1
<input name="P_Id" type="checkbox" value="2"/>投票2
<input name="P_Id" type="checkbox" value="3"/>投票3
</form>
<input name="P_Id" type="checkbox" value="1"/>投票1
<input name="P_Id" type="checkbox" value="2"/>投票2
<input name="P_Id" type="checkbox" value="3"/>投票3
</form>
解决方案 »
- 连SQL数据库报错,求助
- 求VS2010 Ultimate相关资料
- 多线程排序效率问题
- 高手来帮忙啊!急啊~~请来帮帮我,关于<iframe>的棘手问题
- 将datagrid导出到 Excel 的问题(有一段代码,但就是导不出来)
- 急!showModalDialog传递多个参数,高手帮忙!up有分!!
- 关于timer+progressbar控件
- 想实现将Datagridview中的内容导入到Excel中时出错
- 为什么在能用GetString的情况下,不能用GetInt?
- WebSevice 怎么接收 form表单 提交的数据.
- 我通过imagelist控件将图片添加到listview中,现在想通过选择中图片的时候知道图片的路径
- 求 DataGridview Row 资料任意上下移动对调
Response.Write("这个时候说明没有选择checkbox");
}
var cb = docment.getElementByName("P_Id");
for(var i=0;i<cb.length;i++){
if(cb.checked){
b=true;
}
}
if(b==false){
alert("请选择投票!");
}
<input name="P_Id" type="checkbox" value="1"/>投票1
<input name="P_Id" type="checkbox" value="2"/>投票2
<input name="P_Id" type="checkbox" value="3"/>投票3
</form>
这样的FORM在页面中是循环出来的 会有N多个FORM
也就是说 会有N多个FORM里有N多个<input name="P_Id" type="checkbox"
for(int i=0;iPage.Controls.Count;i++){foreach (System.Web.UI.Control control in Page.Controls[i].Controls){if (control is checkbox){if (((checkbox)control).checked) //被选择,看楼主的需要了。{ return;}}}
string Default = checkbox1.Checked ? "1" : "0";