Return value of checkbox
Can i Know what is the return va开发者_如何学Clue for checkbox? Is it string?
<input type="checkbox" name="newproposal" value="checked">
Use the value
attribute to specify the value that will be submitted.
On the server side with JSP, the value will be a String. If it is checked, then the submitted String will be equal to the value
attribute. Use String.equals
to decide whether it was checked.
<%
boolean newproposal_checked = "checked".equals(request.getParameter("newproposal"));
%>
精彩评论