Rick, Ah..misunderstood your original post. Coffee still working its way around. :) What errors are you getting? When I try with a simple onchange call it works fine.
<html:select property="department" onchange="this.form.student.selectedIndex = 1;"> <html:select property="student" size="1"> <html:option value="-1"> select student</html:option> <html:option value="2">Tom</html:option> </html:select> Sounds like it could be js related. Is your populateDependent function being called? steve -----Original Message----- From: Rick Col [mailto:[EMAIL PROTECTED] Sent: Thursday, July 24, 2003 10:21 AM To: Struts Users Mailing List; [EMAIL PROTECTED] Subject: RE: dependent list help! Hi, steve: The department list appears ok, but when I select one department, nothing happens to the student dependent list. It works very well with html/javascript code shown below. Can Struts do the same thing? thanks. --- Steven Santiago <[EMAIL PROTECTED]> wrote: > Rick, > > Have you tried using optionsCollection? Maybe > something like: > > <html:select property="department"> > <html:option value="-1">select > department</html:option> > <html:optionsCollection > property="departments" > label="description" value="id"/> > </html:select> > > steve > <SELECT NAME="department" > onChange="populateDependent(this.form.student, > ((this.selectedIndex == -1) ? null : > students[this.selectedIndex-1]));"> > <OPTION VALUE="-1">Select department > <OPTION VALUE=1>Math > <OPTION VALUE=2>Chemistry > <OPTION VALUE=3>Computer science > <OPTION VALUE=4>English > </SELECT> > <BR> > <SELECT NAME="student" SIZE="1"> > <OPTION> </OPTION> > > > But when I try to convert this into Struts code, it > just does not work! Its driving me crazy. > > <html:select property="department" > onchange="populateDependent(this.form.student, > ((this.selectedIndex == -1) ? null : > students[this.selectedIndex-1]));> > <html:option value="-1">select > department</html:option> > <html:options collection="departments" > property="id"labelProperty="description"/> > </html:select> > </td> > ------------------ > <html:select property="student" size="1"> > <html:option value="-1"> select > student</html:option> > </html:select> > __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]