  | Mailing List | | Home | | Forum Home | | JBoss - Java Application Server | | Struts - A MVC web framework | | Tomcat - JSP/Servlet container | | iText - An open source PDF Java Library | | JDOM - JDOM XML Parser | | J2EE - A mailing list for Java(tm) 2 Platform, Enterprise Edition | | J2EE Pattern - An interest list for Sun Java Center J2EE Pattern Catalog | | Servlet - A mailing list for discussion about Sun Microsystem's Java Servlet API Technology | | JSP - A mailing list about Java Server Pages specification and reference | |
Struts & Hibernate
|
|
|
  | | | Solution for consistent checkbox handling | Solution for consistent checkbox handling 2004-01-27 - By Bob the Builder
Back Hi All,
A recent post asked how you get around null-values for unchecked checkboxes. Although there are many ways around it, sometimes the behaviour is really inconvenient. Picture for instance a page where a checkbox is sometimes suppressed based on the user's rights -- you don't know whether the control was absent or whether it was unchecked.
Now picture the following HTML to get around the problem:
<input type="checkbox" name="isAssignable" value="1"> <input type="hidden" name="isAssignable"< value="0">
request.getParameter("isAssignable") in my environment works properly, in other words I ignore "isAssignable" when null and I update it as a flag if it is not null.
Can anybody see a portability problem or any issues with this approach?
Thanks Bob
=========================================================================== To unsubscribe: mailto listserv@(protected) with body: "signoff JSP-INTEREST". For digest: mailto listserv@(protected) with body: "set JSP-INTEREST DIGEST".
Some relevant archives, FAQs and Forums on JSPs can be found at:
http://java.sun.com/products/jsp http://archives.java.sun.com/jsp-interest.html http://forums.java.sun.com http://www.jspinsider.com
|
|
 |