On 12/9/05, Frank W. Zammetti <[EMAIL PROTECTED]> wrote:
> What are you actually trying to send?  The selected value or the index
> of the selected item?  I also note you have multiple="true"... so you
> expect that more than one can be selected?  I'm not sure if that has a
> bearing on the selectedIndex (I could see where it might), and even if
> it does, the handler code wouldn't seem to account for that.
>
<snip/>

In a multiple <select>, selectName.selectedIndex will always be the
index of the *first* selection, if there are one or more (or -1 if
there are none).

-Rahul


> Frank
>
> Mike Darretta wrote:
> > I thought I had licked this problem - but it only works with Firefox!
> >
> > I have an <html:select> tag that, when a user selects an option, a
> > submit() is forced through a javascript call.
> >
> > The JSP code is:
> >
> > <html:select property="selectedAvailableBeans" size="12" multiple="true"
> >                ...
> >     onclick="handleClick(this)"/>
> >
> > The javascript code:
> >
> > function handleClick(obj, prefix) {
> >    var F_Obj = obj.form;
> >    index = F_Obj.selectedAvailableBeans.selectedIndex;
> >    ...
> >
> >    F_Obj.submit();
> > }
> >
> > This works fine in Firefox, but with IE, the index value is always -1.
> >
> > Can anyone help me with the proper way to post the results of a
> > selection without requiring the user to depress a select button?
> >
> > Thanks,
> >
> >

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

Reply via email to