Jump to content

[SOLVED] get dropdown value (ie/ff)


ProXy_

Recommended Posts

i've done some research the past couple days trying to get my

new ajax site manager to work with internet explorer.

This works great with Firefox.

 

Here is the option tag:

<option value="thename" onclick="Go(this.value)">Pick</option>

 

the function:

function Go(url)
{
document.getElementById(url).style.display = '';
}

 

Appreciate the help.

I've looked all over the forums for some ideas

And i have not stumbled upon any "working" so far.

Link to comment
Share on other sites

The OPTION elements don't appear to support the onclick trigger in IE.

 

If this is a single select list, then you should use the onchange trigger on the SELECT element to get the selected value:

<select name="sel" id="sel" onchange="alert(this.value);">
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
</select>

 

If this is a multi-select list then it becomes more difficult because I'm not sure you can determine which exact option was clicked. If you use "selectedIndex" on the SELECT element it will give you the first selected elment even if you select another element. Plus, you have to consider that the user may be clicking on an element to unselect it.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.