You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Sachin Chowdhary <cs...@pisoftek.com> on 2003/04/19 08:22:20 UTC

Settig True and False in Radio Button (Novice Programmer) Help Plz

I have to Set radio button Acording to value true or false

So How  can i use this.

I have reffered several sites which are saying about setting String value
for String vaiable but not one is talking about for boolean


I have found this worthty but when i am using boolean variable instead of
String
Each radio button element requires an assigned value that distinguishes it
from the other radio buttons. When creating a static array of radio buttons,
you need to indicate which one of these, if any, is checked. This does not
need to be done when the radio buttons are being populated from dynamic
data. The control can compare itself to the form bean's property and then
check itself when appropriate.
Given a set of <html:radio> controls like this:
<html:radio property="expectedVia" value="UPS"/>UPS
<html:radio property="expectedVia" value="FEDX"/>Federal Express
<html:radio property="expectedVia" value="AIRB"/>AirBorne
And that the expectedVia property on the form bean was already set to "UPS",
then the HTML radio elements would be rendered like this:
<input type="radio" name="expectedVia" value="UPS" checked="checked">UPS
<input type="radio" name="expectedVia" value="FEDX">Federal Express
<input type="radio" name="expectedVia" value="AIRB" >AirBorne


 My Code :-

Here useCPA is boolean in ActionForm.It is always checked on which i have
given value="false"

                                        <TD width="20%"
align="right">yes</TD>
			    <TD width="20%" align="left"><html:radio property="useCPA"
value="true" /></TD>
                                        <TD width="20%">&nbsp;</TD>
                                        <TD width="20%"
align="right">No</TD>
                                        <TD width="20%"
align="left"><html:radio property="useCPA" value="false" /></TD>

can aby one help Me it is really important for Me


---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org