Click to See Complete Forum and Search --> : fighting the arrays


larsliin
04-10-2003, 03:32 PM
Hi there
I’ve got two <select>-boxes. The second box changes options according to the first <select>. This works fine, but how do I attach values, in this case URL’s, to the second <select>? Normally this wouldn’t be a problem, but since this script works with arrays it confuses me.
I found the script on the internet.

Check out 'my' script (http://www.larsliin.dk/test.htm)

larsliin
04-11-2003, 02:50 AM
Makes sense, I think. But since I' m not that experienced in javascript, I am still having trouble maiking this work.

I did what you suggested:
selectCtrl.options[j] = new Option(itemArray[i][0], url);

But can't seem to figur out where to put my URL. I imagine that I would place it in the arrays. Am I wrong when I do something like this:
new Array("- Vælg årgang -", 39482302, http://www.blabla.com),

This doesn't work, I'm aware of that, but why ..? Sorry, if this sounds stupid ..