That's be great, but whenever I try to search it I get "Text search not
available for this list"  Pretty useless.  I'm not paging through 60000
posts looking for an answer.


Greg


-----Original Message-----
From: James Childers [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 14, 2003 4:32 PM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: HTML Checkbox...


Check the archives. This is another one of those questions that gets asked
(and answered) frequently.

http://nagoya.apache.org/eyebrowse/SearchList?[EMAIL PROTECTED]
pache.org

Or try the JGuru Struts FAQ:

http://www.jguru.com/faq/printablefaq.jsp?topic=Struts

The short answer is: You're trying to set this in the wrong place. IMO, you
should be setting the default value of your form items in your ActionForm,
not the JSP tag.

Ex:

public class YourForm extends ActionForm {
        private String someCheckBox = "true";   // This sets the default value

        // getters and setters for same; will get called after form submission

        public void reset() {
                someCheckBox = "false";                 // Need this here to handle 
submission of
unchecked boxes
        }
}

In your JSP:

<html:form action="someAction"> <!-- This Action, of course, uses
YourForm -->
        <html:checkbox property="someCheckBox" /> <!-- Will be checked since you
set it to true in your ActionForm -->
</html:form>

-= J

> -----Original Message-----
> From: John Bateman [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, January 14, 2003 3:51 PM
> To: Struts Users Mailing List
> Subject: HTML Checkbox...
>
> Hi
>
> I read the docs but I can't seem to find a way to render this button
> 'checked' when I try and display it.
>
> I've tried:
>
> <html:checkbox name="something" value="true"/>
> <html:checkbox name="something" value="yes"/>
> <html:checkbox name="something" value="YES"/>
>
> And neither of them work.
>
> Thanks
>
>
> --
> 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