For those interested, Ivan Siviero was kind enough to answer my question.
Apparently, you preselect a radio button based on the incoming value from
the form.

So for set of radio buttons...
<html:radio property="propertyname" value="1">
<html:radio property="propertyname" value="2">

you'd preselect the first radio button by having your "getPropertyName()"
method in your ActionForm return a "1" by default.  So you'd want to set the
value that is returned by "getPropertyName()" to "1" at the constructor
level and the reset level (I was only doing it in the reset method).


----- Original Message -----
From: "John M. Corro" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Monday, February 04, 2002 10:39 AM
Subject: Re: Preselecting Radio Buttons


> When it comes to form input tags, I tend to look at the straight html tags
> as a last resort....I prefer to use the struts taglib implementation so
that
> in case the user failed validation tests when submitting the form, the
value
> they selected when first filling it out would stay selected.  Thanks
though!
>
> ----- Original Message -----
> From: "MARK NICHOLS" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, February 04, 2002 10:25 AM
> Subject: Re: Preselecting Radio Buttons
>
>
> Add the 'checked' parm to your default radio button, like so...
>
>
> What is your gender?<br>
> Female <input type="radio" name="gender" value="female" checked>
> Male <input type="radio" name="gender" value="male">
>
>
>
>
> _____________________________
> /\/\ark /\/ichols
> Harris I, 2nd Floor
> 217.558.2919
>
> "Ooo. They've got the Internet on computers now." - Homer Simpson
>
> >>> [EMAIL PROTECTED] 02/04/02 09:57AM >>>
> I would have thought this was a simple thing, but I must be missing
> something.  Is there an attribute to the <html:radio> tag that sets it as
> selected?  I want to have a group of radio buttons w/ 1 button being the
> default.  I didn't see anything in the tag lib documentation and I tried
> coding in the default value into the reset method (so if the form
attribute
> was "programmerLanguage", I would say 'programmerLanguage = "java";' in
the
> reset method., but no luck on either front.
>
> Can anyone provide some insight into this simple problem?
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>
>
>
>
>
> --
> To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>
>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to