Open File Specified In Form (II)

[Total: 0    Average: 0/5]

This example shows how to put two strings together to specify a complete URL path and file.

Body Code:

<script type=text/javascript>
function openHelpWindow() { 
//This function opens the correct Help Window in either in Edit or Read mode. HelpKey2 returns either "Edit" or "Read" 
var _i = document.exf1.helpkey2.selectedIndex;
var tmpMode = document.exf1.helpkey2[_i].value.toString();
winURL = "http://www.js-examples.com/" + tmpMode; 
winName = "Help"; 
winOpts = 'toolbar=no, location=no,directories=no,status=no,scrollbars=yes,menubar=no,resizable=yes,toolbar=no,copyhistory=no,width=500,height=300'; 
HelpWin = window.open( winURL, winName, winOpts ); 
} 
</script>

</head>
<body>
<form name=exf1>
On http://www.js-examples.com/:<BR>
Site To Visit: 
<select name="helpkey2">
    <option value="/">HOME</option>
    <option value="forums/">FORUM</option>
</select>
</form>
<BR>
<a href="javascript:void openHelpWindow()">Open the page specified</a> 

Times Viewed: 4

Leave a Reply

Your email address will not be published. Required fields are marked *