Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trying to open a new window

Status
Not open for further replies.

cic

Technical User
Apr 12, 2001
28
US
I copied this code in order to create two menus that would pull up a pdf file. However, I need the pdf file to open up in a new window. Can someone help me out? The code is below

Thanks

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
<SCRIPT Language=&quot;JavaScript&quot; >

function selectmenu(theme_prin)
{
if (theme_prin.theme.selectedIndex == 0)
{
alert('Please, make another selection');
}
else{
window.top.location.href = theme_prin.theme.options[theme_prin.theme.selectedIndex].value;
}}
menu=new Array()
menu[0]=new Array()
menu[1]=new Array()
menu[2]=new Array()
menu[3]=new Array()
menu[4]=new Array()
menu[5]=new Array()
menu[6]=new Array()
menu[7]=new Array()
menu[8]=new Array()
menu[9]=new Array()
menu[10]=new Array()
menu[11]=new Array()
menu[12]=new Array()
menu[13]=new Array()
menu[14]=new Array()
menu[15]=new Array()
menu[16]=new Array()
menu[17]=new Array()
menu[18]=new Array()
menu[19]=new Array()
menu[20]=new Array()
menu[21]=new Array()
menu[22]=new Array()
menu[23]=new Array()
menu[24]=new Array()
menu[25]=new Array()
menu[26]=new Array()
menu[27]=new Array()
menu[28]=new Array()
menu[29]=new Array()

menu[0][0]=new Option(&quot;General Information&quot;,&quot;
menu[1][0]=new Option(&quot;CIC Overview&quot;,&quot;menu[1][1]=new Option(&quot;Five Institutes&quot;,&quot;menu[1][2]=new Option(&quot;-SCHEDULES-&quot;,&quot;&quot;)
menu[1][3]=new Option(&quot;CIC National Program Schedule&quot;,&quot;menu[1][4]=new Option(&quot;CIC Alaska Schedule&quot;,&quot;menu[1][5]=new Option(&quot;CIC Arkansas Schedule&quot;,&quot;menu[1][6]=new Option(&quot;CIC California Schedule&quot;,&quot;menu[1][7]=new Option(&quot;CIC Hawaii Schedule&quot;,&quot;menu[1][8]=new Option(&quot;CIC Iowa Schedule&quot;,&quot;menu[1][9]=new Option(&quot;CIC Idaho Schedule&quot;,&quot;menu[1][10]=new Option(&quot;CIC Louisiana Schedule&quot;,&quot;menu[1][11]=new Option(&quot;CIC Mississippi Schedule&quot;,&quot;menu[1][12]=new Option(&quot;CIC Nebraska Schedule&quot;,&quot;menu[1][13]=new Option(&quot;CIC New Mexico Schedule&quot;,&quot;menu[1][14]=new Option(&quot;CIC Texas Schedule&quot;,&quot;menu[1][15]=new Option(&quot;CIC Wyoming Schedule&quot;,&quot;menu[1][16]=new Option(&quot;CIC West Virginia Schedule&quot;,&quot;
menu[2][0]=new Option(&quot;CISR General Information&quot;,&quot;&quot;)
menu[2][1]=new Option(&quot;CISR Five Courses&quot;,&quot;&quot;)
menu[2][2]=new Option(&quot;-SCHEDULES-&quot;,&quot;&quot;)
menu[2][3]=new Option(&quot;CISR National Program Schedule&quot;,&quot;&quot;)
menu[2][4]=new Option(&quot;Northeast Schedule&quot;,&quot;&quot;)
menu[2][5]=new Option(&quot;North Central Schedule&quot;,&quot;&quot;)
menu[2][6]=new Option(&quot;Southern Schedule&quot;,&quot;&quot;)
menu[2][7]=new Option(&quot;Western Schedule&quot;,&quot;&quot;)
menu[2][8]=new Option(&quot;Arkansas&quot;,&quot;&quot;)
menu[2][9]=new Option(&quot;California&quot;,&quot;&quot;)
menu[2][10]=new Option(&quot;Hawaii&quot;,&quot;&quot;)
menu[2][11]=new Option(&quot;Iowa&quot;,&quot;&quot;)
menu[2][12]=new Option(&quot;Idaho&quot;,&quot;&quot;)
menu[2][13]=new Option(&quot;Mississippi&quot;,&quot;&quot;)
menu[2][14]=new Option(&quot;New Mexico&quot;,&quot;&quot;)
menu[2][15]=new Option(&quot;North/South Dakota&quot;,&quot;&quot;)
menu[2][16]=new Option(&quot;Texas&quot;,&quot;&quot;)
menu[2][17]=new Option(&quot;Utah&quot;,&quot;&quot;)
menu[2][18]=new Option(&quot;Advanced Lecture Series&quot;,&quot;&quot;)
menu[2][19]=new Option(&quot;-PARTICIPANT INFORMATION-&quot;,&quot;&quot;)
menu[2][20]=new Option(&quot;Completes Course&quot;,&quot;&quot;)
menu[2][21]=new Option(&quot;Update Requirement&quot;,&quot;&quot;)
menu[2][22]=new Option(&quot;Earns Designation&quot;,&quot;&quot;)
menu[2][23]=new Option(&quot;Emeritus Form&quot;,&quot;&quot;)
menu[2][24]=new Option(&quot;Change of Name/Address Form&quot;,&quot;&quot;)
menu[2][25]=new Option(&quot;ACSR&quot;,&quot;&quot;)
menu[2][26]=new Option(&quot;CPSR&quot;,&quot;&quot;)
menu[2][27]=new Option(&quot;Information for CSR of Year&quot;,&quot;&quot;)
menu[2][28]=new Option(&quot;Nomination Form for CSR of Year&quot;,&quot;&quot;)
menu[2][29]=new Option(&quot;Candidate Form for CSR of Year&quot;,&quot;&quot;)


menu[3][0]=new Option(&quot;CRM General Information&quot;,&quot;&quot;)
menu[3][1]=new Option(&quot;Five Courses&quot;,&quot;menu[3][2]=new Option(&quot;Name/Address Change Form&quot;,&quot;menu[3][2]=new Option(&quot;Brochure Order Form&quot;,&quot;menu[3][2]=new Option(&quot;CRM Exam Review Request&quot;,&quot;menu[3][2]=new Option(&quot;-SCHEDULES-&quot;,&quot;&quot;)
menu[3][2]=new Option(&quot;Program Schedule&quot;,&quot;

menu[4][0]=new Option(&quot;Graduate Seminar&quot;,&quot;menu[4][1]=new Option(&quot;-INDUSTRY TOPICES-&quot;,&quot;&quot;)
menu[4][2]=new Option(&quot;Financial Instututions&quot;,&quot;menu[4][3]=new Option(&quot;Contractors&quot;,&quot;menu[4][4]=new Option(&quot;Health Care Entities&quot;,&quot;menu[4][5]=new Option(&quot;Truckers &quot;,&quot;menu[4][6]=new Option(&quot;Truckers II&quot;,&quot;menu[4][7]=new Option(&quot;Oil & Gas&quot;,&quot;menu[4][8]=new Option(&quot;-MANAGEMENT TOPICS-&quot;,&quot;&quot;)
menu[4][9]=new Option(&quot;Marketing and Sales&quot;,&quot;&quot;)
menu[4][10]=new Option(&quot;Managing People&quot;,&quot;menu[4][11]=new Option(&quot;Agency Management Practices&quot;,&quot;menu[4][12]=new Option(&quot;-SINGLE FOCUS TOPICS-&quot;,&quot;&quot;)
menu[4][13]=new Option(&quot;Large Commercial Account&quot;,&quot;menu[4][14]=new Option(&quot;Small Commercial Accounts&quot;,&quot;menu[4][15]=new Option(&quot;Life and Benefits&quot;,&quot;menu[4][16]=new Option(&quot;Personal Lines&quot;,&quot;menu[4][17]=new Option(&quot;-MISCELLANEOUS TOPICS-&quot;,&quot;&quot;)
menu[4][18]=new Option(&quot;Multiple Topic&quot;,&quot;menu[4][19]=new Option(&quot;MEGA&quot;,&quot;
menu[5][0]=new Option(&quot;DYNAMICS OF SELLING&quot;,&quot;&quot;)
menu[5][1]=new Option(&quot;General Information&quot;,&quot;menu[5][2]=new Option(&quot;National Schedule&quot;,&quot;menu[5][3]=new Option(&quot;Thomas G. Williams Fellowship&quot;,&quot;&quot;)
menu[5][4]=new Option(&quot;-DYNAMICS OF SALES MANAGEMENT-&quot;,&quot;&quot;)
menu[5][5]=new Option(&quot;General Information&quot;,&quot;&quot;)
menu[5][6]=new Option(&quot;Schedule&quot;,&quot;&quot;)
menu[5][7]=new Option(&quot;In-House Programs&quot;,&quot;&quot;)

menu[6][0]=new Option(&quot;General Information&quot;,&quot;&quot;)
menu[6][1]=new Option(&quot;Academy Publications at a Glance&quot;,&quot;menu[6][2]=new Option(&quot;-PRODUCTIVITY-&quot;,&quot;menu[6][3]=new Option(&quot;Growth and Performance Standards&quot;,&quot;menu[6][4]=new Option(&quot;Foundations of Customer Service&quot;,&quot;menu[6][5]=new Option(&quot;Maximizing Agency Value&quot;,&quot;menu[6][6]=new Option(&quot;Transactional Filing&quot;,&quot;menu[6][7]=new Option(&quot;Understanding the Wholesale Insurance Market&quot;,&quot;menu[6][8]=new Option(&quot;Critical Factors Impacting Agency Value&quot;,&quot;menu[6][9]=new Option(&quot;-MARKETING-&quot;,&quot;menu[6][10]=new Option(&quot;Fee Based Services&quot;,&quot;menu[6][11]=new Option(&quot;Focused Selling&quot;,&quot;menu[6][12]=new Option(&quot;Producer Compensation&quot;,&quot;menu[6][13]=new Option(&quot;-COVERAGE-&quot;,&quot;menu[6][14]=new Option(&quot;Insuring Home-Based Businesses&quot;,&quot;menu[6][15]=new Option(&quot;Three Faces of Executive Liability&quot;,&quot;menu[6][16]=new Option(&quot;Complete the Circuit&quot;,&quot;
menu[7][0]=new Option(&quot;Ready Reference Guide&quot;,&quot;&quot;)
menu[7][1]=new Option(&quot;Home State Certification Information&quot;,&quot;menu[7][2]=new Option(&quot;Request for Duplication Course Completion Certification&quot;,&quot;menu[7][3]=new Option(&quot;Rush Processing Procedure for Course&quot;,&quot;&quot;)
menu[7][4]=new Option(&quot;Web Based Training Ready Reference Guide&quot;,&quot;&quot;)

function fillList(z){
for (a=document.f.s.options.length-1;a>0;a--){document.f.s.options[a]=null}
for (a=0;a<menu[z].length;a++){document.f.s.options[a]=new
Option(menu[z][a].text,menu[z][a].value)
}
document.f.s.selectedIndex=0
}
</SCRIPT>

</head>

<body bgcolor=&quot;#FFFFFF&quot;>
<FORM NAME=f>
<div align=&quot;center&quot;>
<table width=&quot;845&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
<tr>
<td height=&quot;152&quot;>
<div align=&quot;center&quot;><img src=&quot;../../../website/ASum/Logo.gif&quot; width=&quot;234&quot; height=&quot;88&quot;></div>
</td>
</tr>
<tr>
<td height=&quot;31&quot;>
<div align=&quot;center&quot;></div>
</td>
</tr>
<tr>
<td height=&quot;178&quot;>
<div align=&quot;center&quot;>
<select name=&quot;theme&quot; size=1 onChange=&quot;selectmenu(this.form)&quot;>
<option>Programs</option>
<option value=&quot;Javascript:fillList(0)&quot;>National Alliance</option>
<option value=&quot;Javascript:fillList(1)&quot;>CIC</option>
<option value=&quot;Javascript:fillList(2)&quot;>CISR</option>
<option value=&quot;Javascript:fillList(3)&quot;>CRM</option>
<option value=&quot;Javascript:fillList(4)&quot;>RUBLES</option>
<option value=&quot;Javascript:fillList(5)&quot;>NCIM</option>
<option value=&quot;Javascript:fillList(6)&quot;>Academy</option>
<option value=&quot;Javascript:fillList(7)&quot;>CONTINUING EDUCATION</option>
</select>
<select name=s style=&quot;width:350&quot; size=&quot;1&quot;>
<option value=&quot;#&quot;>Topics
</select>
<input type=button onClick=&quot;location=document.f.s.options[document.f.s.selectedIndex].value&quot; value=&quot;GO&quot; name=&quot;button&quot;>
</div>
</td>
</tr>
</table>
</div>
</FORM>
</body>
</html>
 
instead of
window.top.location.href = theme_prin.theme.options[theme_prin.theme.selectedIndex].value;
you have to say
window.open(theme_prin.theme.options[theme_prin.theme.selectedIndex].value;, &quot;&quot;, &quot;toolbar,menubar,scrollbars.resizable,status&quot;)



HTH
 
Thanks but it seemed to have caused a runtime error. I changed it to window.open(theme....
Is there something else I can try?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top