if(a=1){
b="checked";
}else{
b="";
}<input type =ratio name=r value="0" <%=b%>>
<input type =ratio name=r value="1" <%=b%>>a是数据库中判断哪个被选中的字段,你自己决定
b="checked";
}else{
b="";
}<input type =ratio name=r value="0" <%=b%>>
<input type =ratio name=r value="1" <%=b%>>a是数据库中判断哪个被选中的字段,你自己决定
解决方案 »
- 关于axis2调用webservices出现错误:org.apache.axis2.AxisFault: 服务器无法处理请求。 ---> 未将对象引用设置到对象
- 有了ajax,struts1还有意义吗?(第三次发帖请教)
- object元素不能用,什么原因
- spring 入门新手求救:SimpleUrlHandlerMapping映射问题
- 怎么下Web框架啊?
- 请高手补充一下程序
- Microsoft.NET ★★★★★绝对Java问题★★★★★
- 警示当代汉*!!!勿忘国耻(组图) zt
- 请问:将HTML或者Jsp代码写进JavaBean中编译后调用有什么不好吗?谢谢!
- 下载的jsp源程序中,扩展名为 .tld的文件是什么?
- 再来问问大家一个很水的问题?在线
- jsp如何缓冲页面输出,然后对缓冲作修改再一次性输出到客户端?
<input type =ratio name=r value="1" onClick="ck(1)" >
写个JAVASCRIPT函数
function ck(i){
if (i==0){
//转到某个SERVLET或着通过URL转到某个JSP页面(在此操作数据库)
} else if (i==0){
//转到某个SERVLET或着通过URL转到某个JSP页面(在此操作数据库)
}
}
二.通过if else语句.
<form name="form1" method="post" action="save.jsp">
<%if 值为0 then
输出 <input name="dan" type="radio" value="0" checked>CCW
else
输出 <input type="radio" name="dan" value="1">CCT
</form>
end if%>三.通过提交表单,dan的值重设数据库中的值,若这时选中的为值1,则数据库中的值为1.再次读数据库时,得到值为1,所以已选中的为CCT
连接数据库,取得su的值.
<%
out.println("<form name=form1 method=post action=1.jsp>");
if(su==0){
out.println("<input name=dan type=radio value=0 checked>");
out.println("CCW ");
out.print("<input type=radio name=dan value=1> ");
out.println("CCT");}else{
out.println("<input name=dan type=radio value=0>");
out.println("CCW ");
out.print("<input type=radio name=dan value=1 checked> ");
out.println("CCT");}
out.println("<input type=submit name=submit>");
out.println("</form>");
out.println("<br>");
out.println("</body>");
out.println("</html>");
%>
1.jsp
连接数据库
<%String show=request.getParameter("dan");%>
将数据提交到数据库中