J
jasonfu
Unregistered / Unconfirmed
GUEST, unregistred user!
如何设置checkbox 为"checked" , 如何在返回中获得该值,
请帮我修改这个程序,让checkbox工作,谢谢!
===文件名: checkbox.jsp===
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=gb2312">
<title>notitle</title>
</head>
<body>
<p><b>Whycools Query System</b></p>
<%@ page language="java" import="java.sql.*" %>
<form method="POST" action="checkbox.jsp" name="check">
<input type="checkbox" name="ck_ckbox" value="checked">问题:<input type="text" name="ed_name" value ="">
<input type="submit" value="确定">
</form>
<%
String ckbox=request.getParameter("ed_ckbox");
String name=request.getParameter("ed_name");
if (name!=null) out.print (name);
if (ckbox=="Checked") out.print("Great! it is checked now");
else
out.print(" Still need to try!");
%>
</form>
</body>
</html>
请帮我修改这个程序,让checkbox工作,谢谢!
===文件名: checkbox.jsp===
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=gb2312">
<title>notitle</title>
</head>
<body>
<p><b>Whycools Query System</b></p>
<%@ page language="java" import="java.sql.*" %>
<form method="POST" action="checkbox.jsp" name="check">
<input type="checkbox" name="ck_ckbox" value="checked">问题:<input type="text" name="ed_name" value ="">
<input type="submit" value="确定">
</form>
<%
String ckbox=request.getParameter("ed_ckbox");
String name=request.getParameter("ed_name");
if (name!=null) out.print (name);
if (ckbox=="Checked") out.print("Great! it is checked now");
else
out.print(" Still need to try!");
%>
</form>
</body>
</html>