struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ciaran Hanley" <ciaran.han...@sentenial.ie>
Subject Checking radio button based on object value
Date Wed, 01 Dec 2004 18:19:09 GMT
Hi,

 

I have a form consisting of several radio buttons. Upon form generation I
need radio buttons in the form to be checked based on the attribute of a
bean stored in the session. If the beans property is true then a particular
radio button value of "true" should be checked.

 

Option One

<html:radio property="optionOne" value="true" />

<html:radio property="optionOne" value="false" />

 

Option Two

<html:radio property="optionTwo" value="true" />

<html:radio property="optionTwo" value="false" />

 

I want these preselected based on a bean which has variables corresponding
to each radio button

 

boolean optionOne = false;

boolean optionTwo = true;

 

 

How can I achieve this?

Thanks,

CH


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message