[Javascript] Changing a Combobox content

M lists at gazelasport.sk
Fri Oct 27 17:47:39 CDT 2006


Henrique Rennó  wrote / napísal(a):
> Hello!
> 
> I did a map over an image and every time I click on a mapped point it
> changes the content of a combobox (select). It works fine on firefox but
> internet explorer clears the combo's content every time a mapped point
> is clicked. Is it a problem that can be solved?
> 
> This is what I did:
> 
> A function to change the combo's value:
> 
> function change(newvalue)
> {
> 	document.form_name.select_name.value
>  = newvalue;
> }

AFAIK selects don't have value property in standard javascript (that
gecko defines is different). You need to iterate over .options and find
the index of the desired value. Then set .selectedIndex to this index.



More information about the Javascript mailing list