turtle9270
04-09-2008, 05:40 PM
Hi there,
I was wondering if someone could write a bsic script for me. I went some check boxses then wen the user hits submit .. its opens a new windows with a specific link.
e.g if i had google yahoo msn and dynamic drive as check boxes and i selected google and yahoo then hit submit i would like two new windows to open one with google and the other with yahoo
thanks
paul
rangana
04-10-2008, 02:58 AM
Does this help you ;)
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
*,form{margin:0;padding:0;}
#content
{
width:200px;
padding:20px;
margin:10px auto;
border:3px double #222;
font-family:Tahoma;
font-size:9pt;
}
input{margin:2px 10px;}
</style>
<script type="text/javascript">
window.onload = function()
{
document.myform.mysubmit.onclick = function()
{
var check1 = document.myform.check1;
var check2 = document.myform.check2;
var check3 = document.myform.check3;
if(check1.checked == true)
{
window.open('http://www.google.com','mywindow','width=800,height=500,scrollbar=0');
}
if(check2.checked == true)
{
window.open('http://www.yahoo.com','mywindow1','width=800,height=500,scrollbar=0');
}
if(check3.checked == true)
{
window.open('http://www.dynamicdrive.com','mywindow2','width=800,height=500,scrollbar=0');
}
else
alert('You had not choosen from our checkbox...');
}
}
</script>
</head>
<body>
<div id="content">
<form name="myform">
<input type="checkbox" name="check1"/>Google<br/>
<input type="checkbox" name="check2"/>Yahoo<br/>
<input type="checkbox" name="check3"/>Dynamic Drive<br/><br/>
<input type="submit" value="Open Please" name="mysubmit"/>
</form>
</div>
</body>
</html>
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.