HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Drop Down Menu Links Open in New Window
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Form
View previous topic :: View next topic  
Author Message
Chilly Billy



Joined: 15 Apr 2008
Posts: 1

PostPosted: Tue Apr 15, 2008 12:30 pm     Drop Down Menu Links Open in New Window Reply with quote

I am a newbie. Your tutorial on linking drop down menus works fine, however can the javascript you provided (below) be altered so that all the links open in a new window?

<SCRIPT TYPE="text/javascript">
<!--
function dropdown(mySel)
{
var myWin, myVal;
myVal = mySel.options[mySel.selectedIndex].value;
if(myVal)
{
if(mySel.form.target)myWin = parent[mySel.form.target];
else myWin = window;
if (! myWin) return true;
myWin.location = myVal;
}
return false;
}
//-->
</SCRIPT>


Thank you in advance!
mjpliv



Joined: 11 May 2004
Posts: 406
Location: Nova Scotia

PostPosted: Tue Apr 15, 2008 3:59 pm     Reply with quote

Try this code -

{
window.open(myVal,'window_name','height=600,width=500');
}

Play with the options - here is a site with a selection of options -

http://www.java2s.com/Tutorial/JavaScript/0380__Window/windowparent.htm
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Form All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial