OnChange doesn-t work !!!!

A

Anonymous

Guest
hi,

I have got my script like that

Code:
<script language="JavaScript" type="text/javascript">

</script>

and so in my page to call these function I do:

Code:
<select name="pathway" onChange="swapOptions(window.document.upload.pathway.options[selectedIndex].value);">

<option selected>-- choose a pathway --</option>
<option value="information-technology_C">Information Technology</option>
<option value="internet-technology_C">Internet Technology</option>
<option value="multimedia_C">Multimedia</option>
</select>

But this doesnt work....
I got an error like:

Line:140
char: 1
Error: Object Expected

and line 140 is the line with the onchange on it...
So I have tried just to check

Code:
<select name="pathway" onChange="alert(window.document.upload.pathway.options[selectedIndex].value);">

And its working, I mean I got the value of the selected line...
So wot s wrong when I call this function... and the target select is existing...

ps: I v found this functions on

http://hotwired.lycos.com/webmonkey/98/04/index3a_page10.html?tw=programming

Thanks
francois
 
your arrays are named multimedia_C , _H and _I yet your option values are information-technology_C etc
 
it is because i didnt put all my arrays (i have 9 of them, generated with a php scrpit)

multimedia_C,_I, _H
and same for information-technology and internet-technology

I have just for testing put the value at multimedia_C, ... for my select

In the final version it will have a select for the level (C, H, I) and a select for the subject (multimedia,...)
it will make a concat to give the name of the array....and then display the modules available....(the content of the corresponding array)

I think I gave all the info this time

francois
 
Back
Top