What I am using the JSP to do is display the list of my personal contacts.
So I am using the iterate tag to retrieve the list of personal contact objects from my Form bean. Within the iterate tag I display the name etc. The two checkbox tags on each row of the table are used to set one or more of the returned contacts to a supervisor and if so enable the other checkbox to lock the contact's account. So I need the checkbox tags to be within the iterate tag. Thanks again James for taken time out to answer my question, its much appreciated. Doug -----Original Message----- From: James Mitchell [mailto:[EMAIL PROTECTED]] Sent: 13 May 2002 17:07 To: Struts Users Mailing List Subject: RE: Using onclick within iterate tag I guess I need a bit more info to properly answer/stab-at your question. I assume that you know what the two checkboxes will always be. -Why not just put the two on your jsp and not iterate over them. Or for a more generic approach, say you are writing your own custom taglib like..... <myapp:conditionalCheckbox property="MyMapOfChecks"> or something like that........and this taglib would write out the html necessary to make the second box (or more) disabled/enabled based on the 1st value. Am I way off here??? JM > -----Original Message----- > From: Doug Mclellan [mailto:[EMAIL PROTECTED]] > Sent: Monday, May 13, 2002 11:56 AM > To: Struts Users Mailing List > Subject: RE: Using onclick within iterate tag > > > Sorry, > > I meant the position within the iterator. Within the JSP there is two > checkbox tags for each iteration and I need to only enable the second > checkbox if the first has been checked. > > Doug > > -----Original Message----- > From: James Mitchell [mailto:[EMAIL PROTECTED]] > Sent: 13 May 2002 16:53 > To: Struts Users Mailing List > Subject: RE: Using onclick within iterate tag > > > When you mean "position" do you mean "position within the iterator" or > "position on the page"??? > > JM > > > -----Original Message----- > > From: Doug Mclellan [mailto:[EMAIL PROTECTED]] > > Sent: Monday, May 13, 2002 11:47 AM > > To: Struts Users Mailing List > > Subject: RE: Using onclick within iterate tag > > > > > > Hi again, > > > > Many thanks James for helping us out, that works great. > > > > Apologies for not asking the question properly first time around. But > is > > it possible to also pass the position of the checkbox that has been > > clicked so that the JavaScript function could be used to control other > > checkbox tags within the iterate tag. > > > > Thanks again. > > > > Doug > > > > -----Original Message----- > > From: James Mitchell [mailto:[EMAIL PROTECTED]] > > Sent: 13 May 2002 16:10 > > To: Struts Users Mailing List > > Subject: RE: Using onclick within iterate tag > > > > > > try this... > > > > > > <html:checkbox property="checkBox1" > > onclick="JavaScript:handleCheckbox(this)"/>Check 1<br> > > <html:checkbox property="checkBox2" > > onclick="JavaScript:handleCheckbox(this)"/>Check 2<br> > > <html:checkbox property="checkBox3" > > onclick="JavaScript:handleCheckbox(this)"/>Check 3<br> > > <html:checkbox property="checkBox4" > > onclick="JavaScript:handleCheckbox(this)"/>Check 4<br> > > > > <SCRIPT LANGUAGE=javascript> > > <!-- > > function handleCheckbox(obj){ > > alert(obj.name); > > > > } > > //--> > > </SCRIPT> > > > > JM > > > > > -----Original Message----- > > > From: Doug Mclellan [mailto:[EMAIL PROTECTED]] > > > Sent: Monday, May 13, 2002 10:31 AM > > > To: [EMAIL PROTECTED] > > > Subject: Using onclick within iterate tag > > > > > > > > > > > > Hi, > > > > > > I am using onclick event handler on a checkbox tag within a iterate > > tag, > > > since there is going to be multiple checkbox tags can someone please > > > tell me how I can pass the identifier of the checkbox that has fired > > the > > > onclick event to the JavaScript function specified in the onclick. > > > > > > Thanks. > > > > > > Doug > > > > > > -- > > > 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]> > > > > -- > 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]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>