Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: SV: RE: How to open a new window when a form submits


Message #1 by "Robert Nyman" <robert.nyman@c...> on Thu, 12 Dec 2002 17:39:24 +0100
I got it to work finally.  Thanks for all input!:

<script language="javascript">
Check(){
if (myform.employmenttype==true) {
myWin=window.open('somepage.htm', 'myWin',
toolbar=no,location=nos,directories=no,status=no,menubar=no,scrollbars=y
es,
resizable=yes,height=400,width=500');
//didn't need this line --> document.getElementById('myform').target=myWin;
document. myform.submit();
	}
	else {
		window.alert("You need to check employment type")
}
</script>

<form name="myform" method="post" target="myWin" action="index.cfm">
<input type="checkbox" Name="employmenttype" value="test">
<input type="text" name="Testing" value="another input value">
<input type="button" value="submit" onclick="return check();">
</form>

Anne 

  Return to Index