struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anthony N. Frasso" <>
Subject Re: Dynamically Initializing Checkbox Value
Date Tue, 29 Aug 2006 00:40:36 GMT
> Do you need one checkbox or a series of checkboxes?

Just one. :)

> For one checkbox you write something like this (from
> the article):
> <html:checkbox property="married" value="yes"/>

As I understand it, what this tag does is place the
value "yes" into the property "married" of the form
bean associated with this HTML form (actually, "yes"
and "true" for checkboxes will simply place a "true"
boolean value in the boolean property "married"). 
What it does not do, however, is have the form
initialized to have this checkbox set as true.  What I
need is something sort of like the following:

<html:checkbox property="married" value="yes"
initialValue="${myBean.married}" />

Does this clear up what I'm looking for?

The generated HTML should look like:

<input type="checkbox" checked="true">

where the value of the "checked" parameter is the
evaluation of "${myBean.married}".

Thanks again for your help!  I am reviewing the code
samples on the site now.

Anthony Frasso

Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message