Value from Dynamic drop down select

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>
 
A

ameshkin

WOW. So literally right after I posted this, I figured out what I was
doing wrong :(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top