Archive for the ‘ Web Snipetts ’ Category

Combobox On change

If you need to get a value for the selected item in a combo box you can use the following function :

onchange=”alert(this.options[this.selectedIndex].text)

if you need the value then just replace text with value .

For example, if you want to redirect the page based on combobox selection :

onchange=”window.location=”http://someadress”+(this.options[this.selectedIndex].text)