View Full Version : myslt has no properties

12-17-2006, 07:26 AM
Here is the generated code:


<h2>Music Albums</h2>
<script src="data.js"></script>
<div style="position: relative; top: 20px; left: 3%;">
<div style="color: green;">Musician</div>
<select id="mymusic" multiple="multiple" size="10" onclick="opt_click()">
<option name="opt1">Diana Krall</option>
<option name="opt1">Shania Twain</option>
<option name="opt1">The Beatles</option>
<option name="opt1">BeeGees</option>

<div style="color: red;">Genre</div>
<select id="mygenre" multiple="multiple" size = "10" onclick="check_click()">
<option name="opt2">jazz</option>
<option name="opt2">country</option>
<option name="opt2">rock</option>
<div style="position: absolute; top: 20px; left: 20%;">
<div id="div1">

<script src="events.js"></script>

And here is my function

function opt_click()
var mychk = document.getElementById("mygenre");
var mydiv = document.getElementById("div1");
var myslt = document.getElementById("myartist");
var outsl = "";
var the_out = new Array();

for(var k=1;k<album.length;k+=album_size)
var m = myslt.options[i];
var found=false;
for(var j=0;j<the_out.length;j++)
if(m == the_out[j])
found = true;
outsl = outsl + p;
mydiv.innerHTML = outsl;

Here's what I have to do. Take the select box, named 'myartist'. Scan that select box, to see what the user has selected. Assume that in the array 'album', there are the names of the artists on every 5th interval (1, 6, 11). I want to take whatever the user selected, input it into an array; at the point I'm at, all I want to get back are the names, but I need to get back other things besides just the name (pictures, song titles, genre).

If you can't see what i'm doin, jus ask.
The way I see it is this: you have this id of 'myartist', and in the function, it is changed to 'myslt'. But mozilla tells me myslt has no properties. How is this happening?

12-17-2006, 07:35 AM
nevermind...i'm retarded...I changed the id of my select box and didn't change it of my get element function...-_-

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum