Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

jsp checkbox

Status
Not open for further replies.

jagprg

Programmer
Jun 16, 2005
11
0
0
US
HI,

I have a jsp page with 2-3 check boxes, I get the object from the database which returns a boolean, How do I use that to set the checkbox

Code:
<html:checkbox property="Supplies"  value='<%= obj.getUnmeteredTO().getSupplies() ? "true" : "false" %>'/> -- Supplies<br/>

I am able to set the value but not the check box itself, how do i set it so that it is visible as checked on the jsp page.(depending on the value from db)

thanks
 
Tried that, got the following error

jsp/include/worksheet.jsp(19): for tag 'checkbox' handler type 'org.apache.struts.taglib.html.CheckboxTag' has no property 'checked'

 
try this

Code:
<html:checkbox property="Supplies"  
   <%= obj.getUnmeteredTO().getSupplies() ? "checked" : "" %>
/>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top