Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-27-2005, 03:02 PM   PM User | #1
Andreas Sweden
New to the CF scene

 
Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Andreas Sweden is an unknown quantity at this point
How do I get this combobox to open page in another frame?

Code:
function gone()
{
location=document.jumpy.example.options[document.jumpy.example.selectedIndex].value
}
//-->
</script>

</form>
What do I change for this combobox to open the page in another frame?
Andreas Sweden is offline   Reply With Quote
Old 05-27-2005, 03:31 PM   PM User | #2
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
function gone()
{
window.open(document.jumpy.example.options[document.jumpy.example.selectedIndex].value,'framename')
}
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Old 05-27-2005, 03:40 PM   PM User | #3
Andreas Sweden
New to the CF scene

 
Join Date: May 2005
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Andreas Sweden is an unknown quantity at this point
Thank you very much, I have to start learning this stuff and stop cuting and pasting
Andreas Sweden is offline   Reply With Quote
Old 05-27-2005, 04:36 PM   PM User | #4
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
the method is

window.open(url,target,attributes)

The method's arguments are all strings (or variables set as strings). Attributes must be separated by commas ('width=500,height=300,left=10'). Target and attributes are optional. If no target, the default target is _blank. If no attributes, the opened window has different size and position according to the browser type. Attributes may hide scroolbar, location bar, toolbar and so on...

See also
http://www.devguru.com/Technologies/.../win_open.html
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Old 05-27-2005, 05:52 PM   PM User | #5
rlemon
Senior Coder

 
Join Date: Apr 2005
Posts: 1,051
Thanks: 0
Thanked 0 Times in 0 Posts
rlemon is on a distinguished road
JS
Code:
function mnu_func(opt){
	var myOpt = document.getElementById("mnu_"+opt);
	var myFrame = document.getElementById('frameID');
	myFrame.src = myOpt;
	myFrame.focus();
}
HTML
Code:
<select onChange="mnu_func(this.selectedIndex)">
	<option id="mnu_0" value="option1.html">option1</option>
	<option id="mnu_1" value="option2.html">option2</option>
	<option id="mnu_2" value="option3.html">option3</option>
	<option id="mnu_3" value="option4.html">option4</option>
	<option id="mnu_4" value="option5.html">option5</option>
	<option id="mnu_5" value="option6.html">option6</option>
	<option id="mnu_6" value="option7.html">option7</option>
	<option id="mnu_7" value="option8.html">option8</option>
</select>
however I think this will only work with iframes.

for frames using frameset you might have to replace
var myFrame = document.getElementById('frameID');

with

var myFrame = parent.frameName;
(also might want to try self.frameName - i havn't tested this).
__________________
public string ConjunctionJunction(string words, string phrases, string clauses)
{
return (String)(words + phrases + clauses);
}
<--- Was I Helpfull? Let me know ---<
rlemon is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 02:44 PM.


Advertisement
Log in to turn off these ads.