页面上很多checkbox,第一次选择了其中了很多个之后,存如数据库
第二次进到页面,怎么然存入数据库的默认勾上
就是一个回显过程
第二次进到页面,怎么然存入数据库的默认勾上
就是一个回显过程
解决方案 »
- struts2 英文值传递出现乱码! 在线等高手江湖救急!!!!
- Struts2 execAndWait拦截器和token拦截器一起使用出错,单独没有问题
- tomcat怎么配置JDK啊
- 急啊~~关于论坛处理自定义头像的一个小问题~在线等
- http协议下的大文件断点上传
- 有钱赚了!谁做过类似于阿里巴巴的B2B的电子商务网站?有合作的机会!
- 我想在页面中实现将web服务器重启的功能
- onChange="if( options[selectedIndex].value!='')window.location='index.jsp?BM='options[selectedIndex].value''"?
- 各位高手请帮忙,如果我在框架网页中弹出一个新的窗口,在新窗口中执行一定的操作后,怎样让框架网页自动刷新?
- JSP 获取表单指定数据
- 刚学JSP的一些问题(HTML的问题)??
- 域名的问题
<input type="checkbox" name="checkbox" value="1" <%
for (int i = 0 ;i < checkboxValues .length;i++){
if (checkboxValues[i].equals("1") ){
out.println("checked");
break;
} }%> >1
<input type="checkbox" name="checkbox" value="2"
for (int i = 0 ;i < checkboxValues .length;i++){
if (checkboxValues[i].equals("2") ){
out.println("checked");
break;
} }%>>2<input type="checkbox" name="checkbox" value="3">3
1。在标签中加入checked 控制由数据库内容控制
2。写在js中,页面加载后才可以选中。
ReflectionUtils.setFieldVlaue(scheduleForm, "extflg","1".equals(dto.getExtflg()) ? "on" : "");jsp
<html:checkbox name="ScheduleForm" property="<%=extflg%>" value="on" />update
String extflg = (String) ReflectionUtils.getFieldVlaue(scheduleForm, "extflg");
dto.setExtflg("on".equals(extflg) ? "1" : "0");
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
.STYLE3 {
font-size: xx-large;
color: #00FF00;
font-weight: bold;
}
-->
</style>
</head><body background="527527527.jpg">
<p> </p>
<p> </p>
<p> </p><%
int n=0;
String s1=request.getParameter("A");
String s2=request.getParameter("B");
String s3=request.getParameter("C");
String s4=request.getParameter("D");
String s5=request.getParameter("E");
String s6=request.getParameterValues("F");
session.setAttribute("six",s6);
String s7=request.getParameterValues("G");
session.setAttribute("seven",s7);
String s8=request.getParameterValues("H");
session.setAttribute("eight",s8);
String s9=request.getParameterValues("I");
session.setAttribute("nine",s9);
%>
<br>
<%
String s6=(String)session.getAttrinbute("six");
String s7=(String)session.getAttrinbute("seven");
String s8=(String)session.getAttrinbute("eight");
String s9=(String)session.getAttrinbute("nine");
%>
<%
if(s1==null)
{s1="";}
if(s2==null)
{s2="";}
if(s3==null)
{s3="";}
if(s4==null)
{s4="";}
if(s5==null)
{s5="";}
if(s1.equals("a"))
{n++;}
if(s2.equals("a"))
{n++;}
if(s3.equals("a"))
{n++;}
if(s4.equals("c"))
{n++;}
if(s5.equals("a"))
{n++;}
if(s6.equals("abcef"));
{n++;}
if(s7.equals("abc"))
{n++;}
if(s8.equals("abef"))
{n++;}
if(s9.equals("abcd"))
{n++;}
%>
<p><span class="STYLE3">你的得分为:</span><%=n%>
</body>
</html>帮忙看一下这段代码,也是复选的,调试不能通过