Open File Specified In Form

[Total: 0    Average: 0/5]

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

Head 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 tmpMode = document.exf1.helpkey2.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>

Body Code:

<form name=exf1>
On http://www.js-examples:<BR>
Site To Visit: <input type=text name=helpkey2 value="index.html">
</form>
<BR>
<a href="javascript:void openHelpWindow()">open the page specified</a>

Times Viewed: 3

Leave a Reply

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