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
https://forums.phpfreaks.com/topic/176679-solved-get-dropdown-value-ieff/
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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.