You are here: irt.org | FAQ | JavaScript | Form | 11 | Q1129 [ previous next ]
Try:
<script language="JavaScript"><!--
function openWin(theForm) {
w = theForm.theWidth.value;
h = theForm.theHeight.value;
props = 'width='+w+',height='+h;
if (theForm.theStatus.checked) props += ',status';
if (theForm.theMenubar.checked) props += ',menubar';
window.open(theForm.pagename.value,'winname',props);
}
//--></script>
<form onSubmit="openWin(this)">
Page: <input type="text" name="pagename"><br>
Status:<input type="checkbox" name="theStatus"><br>
Menu:<input type="checkbox" name="theMenu"><br>
<input type="button" onClick="openWin(this.form)" value="open">
</form>