The form propert will be whatever is rendered in the name attribute. Try this. 

function fillSelect(myform) {
  theSelect = myform.elements['userForm.agencyId'];
  


On Wed, 17 Nov 2004 11:24:36 -0600, Apte, Dhanashree (Noblestar)
<[EMAIL PROTECTED]> wrote:
> Hi,
> 
> In my jsp, i am using nested properties of a form.
> 
> RoleForm has UserForm which has agencies, agencyName and agencyId within it.
> The agencies and divisions need to be displayed in dropdown boxes.
> 
> I got this to display correctly on my jsp using:
> 
> <html:select property="userForm.agencyId" onchange="fillSelect(this.form)">
> 
> <html:option key="select.generic" value="" />
> 
> <html:optionsCollection property="userForm.agencies" value="agencyId"
> label="agencyName" />
> 
> </html:select>
> 
> However, in the javascript for the onChange of this dropdown, i need a
> handle to this dropdown.
> the fillSelect function needs to do:
> function fillSelect(el)
> 
> {
> 
>        var theSelect = el.agencyId;  // <== How do i get the dropdown handle
> here?
> 
>        var num = theSelect.options[theSelect.selectedIndex].value;
> 
>                           :
> 
>                           : // more procesing
> 
> }
> 
> With the above, i get the error: theSelect has no properties.
> 
> If i put in var theSelect = el.userForm.agencyId, i get the error:
> el.userForm has no properties.
> 
> What would be the correct way to access the dropdown box?
> 
> Any help appreciated.
> Thanks,
> Dhanashree.
> 
>

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

Reply via email to