inherit
58740
0
Aug 20, 2024 7:29:21 GMT -8
®i©hie
I'm not very active here anymore thanks to my full-time job. - 12/27/23
14,036
September 2005
soe
|
Post by ®i©hie on Nov 27, 2009 10:14:25 GMT -8
<option value="VALUE">OPTION NAME</option>
how can i get the value in red? i know how to get the value of the option, axample:
document.name.whatever.options.value
but how would i grab the name of the option?
|
|
inherit
125499
0
Nov 8, 2011 4:03:57 GMT -8
moneyman18
:-
952
June 2008
moneyman18
|
Post by moneyman18 on Nov 27, 2009 11:24:24 GMT -8
document.form.select.options[0].text
You may have to loop through the options depending on what you are wanting to do.
|
|
inherit
58740
0
Aug 20, 2024 7:29:21 GMT -8
®i©hie
I'm not very active here anymore thanks to my full-time job. - 12/27/23
14,036
September 2005
soe
|
Post by ®i©hie on Nov 27, 2009 11:36:13 GMT -8
document.form.select.options[0].text You may have to loop through the options depending on what you are wanting to do. i already know about that. nvm, i'll try to find a work around for what i wanted to do.
|
|
inherit
125499
0
Nov 8, 2011 4:03:57 GMT -8
moneyman18
:-
952
June 2008
moneyman18
|
Post by moneyman18 on Nov 27, 2009 11:42:18 GMT -8
I figured that that wasn't what you were after, but that was the way I interpreted it as. Could you possibly explain better what you are wanting to do? Maybe its the way I'm reading it...I dunno.
|
|
inherit
58740
0
Aug 20, 2024 7:29:21 GMT -8
®i©hie
I'm not very active here anymore thanks to my full-time job. - 12/27/23
14,036
September 2005
soe
|
Post by ®i©hie on Nov 27, 2009 12:08:43 GMT -8
I figured that that wasn't what you were after, but that was the way I interpreted it as. Could you possibly explain better what you are wanting to do? Maybe its the way I'm reading it...I dunno. ok, i made my own dropdown YouTube Video selector & i want to add in a way to include the link to the lyrics for the video by changing the name variable. example: document.write('<a href="lyrics/'+name+'.txt" target="_blank">'+title+' Lyrics</a>'); -Removed Link By Poster-
|
|
inherit
125499
0
Nov 8, 2011 4:03:57 GMT -8
moneyman18
:-
952
June 2008
moneyman18
|
Post by moneyman18 on Nov 27, 2009 14:20:39 GMT -8
I think I understand now. So you want to write a link to the page when a video is selected with its contents the text of the currently selected option + 'lyrics', and the href to be the name of the lyrics filew also specified within the option tag. No? The way I would do it would probably be to have the value of the option tag to be like: <option value=" Youtube vid Id: Name of Lyrics Page"> Vid</option> And the javascript part would be something like below <script type="text/javascript"><!-- function youtube(){ var index = document.yt.vid.selectedIndex; var option = document.yt.vid.options[index]; var optionValue = option.value.split(':'); document.getElementById("show").innerHTML = '<object width="425px" height="344px"><param name="movie" value="http://youtube.com/v/'+optionValue[0]+'&hl=en_US&fs=0&rel=0&autoplay=1&loop=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://youtube.com/v/'+optionValue[0]+'&hl=en_US&fs=0&rel=0&autoplay=1&loop=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425px" height="344px"></embed></object>'; if(index != 0){ document.getElementById("show").innerHTML += '<br /><a href="/lyrics/'+optionValue[1]+'.txt">'+option.text+' Lyrics</a>'; index = '0'; } } //--></script> Then when the link is printed it would be <a href="/lyrics/ Name of Lyrics Page.txt"> Vid Lyrics</a> Not sure if thats the best way to do it... If thats still not what you are after there must be something wrong with me.
|
|
inherit
58740
0
Aug 20, 2024 7:29:21 GMT -8
®i©hie
I'm not very active here anymore thanks to my full-time job. - 12/27/23
14,036
September 2005
soe
|
Post by ®i©hie on Nov 30, 2009 12:46:20 GMT -8
Exactly What i wanted to do (minus the placement of the lyrics link).
Thanks moneyman18! ;D ;D
|
|