DimisD
02-25-2007, 11:41 PM
Hi there,
I have the form below and i want when the checkbox is checked, or when the second drop down menu selected "_blank", to open in a new window.
Can somebody help??
thank you
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<SCRIPT LANGUAGE=javascript>
function go() {
location=document.form1.menu.options[document.form1.menu.selectedIndex].value;
target=document.form1.menu2.options[document.form1.menu2.selectedIndex].value;
// OR USING A BOX THE CODE WOULD BE????
// if (document.form1.checkbox.checked == true) { target="blank");
}
</SCRIPT>
</head>
<body>
<form name="form1" >
<select style="font-size:12px;color:#006699;font-family:verdana;background-color:#ffffff;" name="menu">
<option value="http://www.google.com" selected>Gooooogleit</option>
<option value="http://www.yahoo.com">Yahoooooit</option>
</select>
<input style="font-size:12px;color:#ffffff;font-family:verdana;background-color:#006699;" type="button" onClick="go()" value="Go">
<p> </p>
<select style="font-size:12px;color:#006699;font-family:verdana;background-color:#ffffff;" name="menu2">
<option value="parent" selected>parent</option>
<option value="blank">blank</option>
</select>
<input type="checkbox" name="checkbox" value="_blank" checked="checked" />
</form>
</body>
</html>
I have the form below and i want when the checkbox is checked, or when the second drop down menu selected "_blank", to open in a new window.
Can somebody help??
thank you
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<SCRIPT LANGUAGE=javascript>
function go() {
location=document.form1.menu.options[document.form1.menu.selectedIndex].value;
target=document.form1.menu2.options[document.form1.menu2.selectedIndex].value;
// OR USING A BOX THE CODE WOULD BE????
// if (document.form1.checkbox.checked == true) { target="blank");
}
</SCRIPT>
</head>
<body>
<form name="form1" >
<select style="font-size:12px;color:#006699;font-family:verdana;background-color:#ffffff;" name="menu">
<option value="http://www.google.com" selected>Gooooogleit</option>
<option value="http://www.yahoo.com">Yahoooooit</option>
</select>
<input style="font-size:12px;color:#ffffff;font-family:verdana;background-color:#006699;" type="button" onClick="go()" value="Go">
<p> </p>
<select style="font-size:12px;color:#006699;font-family:verdana;background-color:#ffffff;" name="menu2">
<option value="parent" selected>parent</option>
<option value="blank">blank</option>
</select>
<input type="checkbox" name="checkbox" value="_blank" checked="checked" />
</form>
</body>
</html>