squarefish
05-01-2003, 08:24 AM
I'm trying to write a script that changes the content of a layer depending on the selection from a dropdown menu.
I have an array called content[6] which holds the info to be displayed, and a function which changes the displayed info, the function is call (imaginativley)
changetext(whichcontent)
And the value of whichcontent will be 0 to 6 to pick up the item in the array.
I need to call this from the <select> so I have this
<select name="menu1" class=dropdown onchange="javascript:changetext(content['+this+'])">
<option value="0">Option 1</option>
<option value="1">Option 2</option>
<option value="2">Option 3</option>
etc...
</select>
I know my function changetext() works, but when I call it from the selected option I just get "undefined"
I think the problem is with
onchange="javascript:changetext(content['+this+'])"
Richard
I have an array called content[6] which holds the info to be displayed, and a function which changes the displayed info, the function is call (imaginativley)
changetext(whichcontent)
And the value of whichcontent will be 0 to 6 to pick up the item in the array.
I need to call this from the <select> so I have this
<select name="menu1" class=dropdown onchange="javascript:changetext(content['+this+'])">
<option value="0">Option 1</option>
<option value="1">Option 2</option>
<option value="2">Option 3</option>
etc...
</select>
I know my function changetext() works, but when I call it from the selected option I just get "undefined"
I think the problem is with
onchange="javascript:changetext(content['+this+'])"
Richard