PDA

View Full Version : Pull down menu targeting an i-frame


animepixel
09-21-2005, 12:56 AM
Well i have a pull down menue , and i want to target an i-frame . Well her is the code . I have tried the target="iframe" code , but it dosent work . Or maybe could you direct me to a also good pull down menue that can target and i-frame .


<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
window.location.href = URL;
}
// End -->
</SCRIPT>
</HEAD>



<BODY>

<form name="form">
<select name="site" size=1 onChange="javascript:formHandler()">
<option value="">Music
<option value="music.html" target="iframe">Yahoo
<option value="http://www.metacrawler.com">Metacrawler
<option value="http://www.altavista.digital.com">Altavista
<option value="http://www.webcrawler.com">Webcrawler
<option value="http://www.lycos.com">Lycos
<option value="http://javascript.internet.com">JavaScript Source
</select>
</form>

maskd
09-21-2005, 03:18 AM
Try this:

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
function formHandler(form){
var URL = document.form.site.options[document.form.site.selectedIndex].value;
frames['name-iframe'].location.href = URL;
}
// End -->
</SCRIPT>


and in your iframe, put name="name-iframe" or change it.

Got this from this page: http://www.xs4all.nl/~ppk/js/iframe.html

Haven't tested it so I don't know if it would work, but I'm pretty sure that's how you'd get it to work

animepixel
09-21-2005, 10:41 PM
Well i have another question , how would i customize the pull down menu . Such ad making bold one name such as MUSIC instead of music . Also thanks for the suggestion it worked .

Pegasus
09-22-2005, 12:43 AM
<option value=""><b>Music</b>

Would that work?

_Aerospace_Eng_
09-22-2005, 12:50 AM
No only gecko browsers allow you to style the options. Gecko as in Firefox and Netscape.

animepixel
09-22-2005, 01:07 AM
<option value=""><b>Music</b>

Would that work?


I tried that , but it wouldnt work . But really , only gecko , Hmm, well thanks anyway . :boogy: