struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Meeraj Kunnumpurath <Meeraj.Kunnumpur...@mutant-tech.com>
Subject RE: multiple checkboxes
Date Thu, 12 Jul 2001 08:05:42 GMT
You can only define the multibox tag within the form tag. I think the
multibox tag will check for an indexed property within the form bean
corresponding to the name defined for the checkoxes and render each one of
them as checked or unchecked accordingly.

An example is shown below

<html:form action="validateEmployee.do">
	<logic:iterate id="currentSkill" name="skillsList">
		<html:multibox property="skills">
			<%= currentSkill %>
		</html:multibox>
		<%= currentSkill %>
		<br/>
	</logic:iterate>
<html:form action="validateEmployee.do">

In the example above the body content of the multibox tag is used to define
the value attribute of each check box. The name of all the checkboxes will
be skills. The state of each checkbox is computed by checking the indexed
property skills defined in the action form bean. You can also use the
multibox tag without relying on the body content.

Regards

<Meeraj/> 

-----Original Message-----
From: Leander Jedamus [mailto:jedamus@Fh-Worms.DE]
Sent: Thursday, July 12, 2001 8:41 AM
To: struts-user@jakarta.apache.org
Subject: Re: multiple checkboxes


Hi!

Now my question is, how do I get the aid from the Form into the
checkbox?

Meeraj Kunnumpurath wrote:
> 
> You can use the multibox tag
> 
> Regards
> 
> <Meeraj/>
> 
> -----Original Message-----
> From: Leander Jedamus [mailto:jedamus@Fh-Worms.DE]
> Sent: Thursday, July 12, 2001 8:21 AM
> To: struts-user@jakarta.apache.org
> Subject: multiple checkboxes
> 
> Hi!
> 
> I have one problem I cannot solve on my own.
> I have an not known number of answers with answer-ids in my database.
> Now I want to create a Form to reflect that.
> How do I manage an array of checkboxes?
> What do I have to do to get the following HTML-code?:
> <input type="checkbox" name="aids" value="4">Text
> <input type="checkbox" name="aids" value="2" checked>Text2
> 
> Thanks in advance
> Leander
> --
> Dipl.-Inf. (FH) Leander Jedamus
> Presse- und Öffentlichkeitsarbeit
> Fachhochschule Worms, Erenburgerstr. 19, 67549 Worms, Tel.: 06241
> 509-169
> mailto:presse@fh-worms.de

-- 
Dipl.-Inf. (FH) Leander Jedamus
Presse- und Öffentlichkeitsarbeit
Fachhochschule Worms, Erenburgerstr. 19, 67549 Worms, Tel.: 06241
509-169
mailto:presse@fh-worms.de

Mime
View raw message