A
ameshkin
I am trying to put the selectedindex of a select drop down with the ID
and NAME of quid into a function name. The OK button, needs this
value passed to a function called addVideo. I thought the code below
should work, but the error I'm getting is getIndex() NOT DEFINED. I'm
very new to JS, and maybe someone knows an easier way to do this. The
url to this code can be accessed here http://sickplaylist.com/video-detail.php?id=XCjeDwLvOtU
<div id="innder-vid-box">
<h4>Add Video to Playlist</h4>
<select id="qid" name="qid">
<option id="1">monkey</option>
<option id="7">sdfa</option>
<option id="8">sdfa</option>
<option id="9">sdfa</option>
<option id="3">sdfa</option>
</select>
<input type="button" onclick="addVideo('XCjeDwLvOtU','Anjelah Johnson
talks about how Latinos are very
family oriented.','Family Oriented - Anjelah Johnson - Comedy
Time','http://i.ytimg.com/vi/XCjeDwLvOtU
/2.jpg',getIndex())" value="OK" />
</div>
<script type="text/javascript">
function getIndex()
{
return document.getElementById("qid").selectedIndex;
}
</script>
and NAME of quid into a function name. The OK button, needs this
value passed to a function called addVideo. I thought the code below
should work, but the error I'm getting is getIndex() NOT DEFINED. I'm
very new to JS, and maybe someone knows an easier way to do this. The
url to this code can be accessed here http://sickplaylist.com/video-detail.php?id=XCjeDwLvOtU
<div id="innder-vid-box">
<h4>Add Video to Playlist</h4>
<select id="qid" name="qid">
<option id="1">monkey</option>
<option id="7">sdfa</option>
<option id="8">sdfa</option>
<option id="9">sdfa</option>
<option id="3">sdfa</option>
</select>
<input type="button" onclick="addVideo('XCjeDwLvOtU','Anjelah Johnson
talks about how Latinos are very
family oriented.','Family Oriented - Anjelah Johnson - Comedy
Time','http://i.ytimg.com/vi/XCjeDwLvOtU
/2.jpg',getIndex())" value="OK" />
</div>
<script type="text/javascript">
function getIndex()
{
return document.getElementById("qid").selectedIndex;
}
</script>