Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

simple window.open problem.

Status
Not open for further replies.

billycat

MIS
Apr 28, 2005
22
US
Cannot get the code correct to open the window at a certain size. If i remove the width + height stuff, the window opens fine.. Would it be easier to use JS on the child window to specify size?

Code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<SCRIPT LANGUAGE="JavaScript">
function testResults (form) {
var TestVar = form.mylist.value;
window.open('toolbar=0, scrollbars=0, resizable=0, width=200, height=100' , 'select_options.php?row=' + TestVar);
decodeURI(document.myform.values.value);
}



function enableField()
{
document.myform.wild.disabled=false;
}
 
</script>


</head>
<body>
<table bgcolor="#d0cece" cellspacing="3">
<tr>
<td valign=top>
<?
include('includes/db.php');

echo "<form name=myform>";
echo "<b><font size=2 face=arial>Field:&nbsp;&nbsp;&nbsp;&nbsp;</b>";

$q = "SELECT row_name FROM ".DB_TABLE_ROWNAMES;
$result = $database->query($q);
	$num = mssql_num_rows($result);

	for($i = 0; $i < $num; $i++){
	$row = mssql_fetch_array($result);
	
	$array[$i] = $row['row_name'];

		}
	echo "<select name=mylist class=formfield>";
sort($array);
$arr = array_unique($array);

foreach($arr as $line){
	echo "<option value=".$line.">".$line; }
echo "</select>";
  ?></td><td>
<input type="radio" name="wild" value="wildcard" ><font size=2  face=arial><b>wildcard</b>
<input type="text" name="wildcard"><br>
<input type="radio" name="wild" value="value" onClick=testResults(this.form)><font size=2  face=arial><b>value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b>
<?
$form = "<INPUT TYPE=\"text\" NAME=\"values\" value=\"\" >"; 
echo rawurldecode($form);
?>



</td>
</tr>
</table>
<input type="button" value="submit" onClick="window.open('test.php?row=' + this.form.values.value);">
</FORM>
</BODY>
</HTML>

 
Your syntax is incorrect for the window.open statement.

Syntax is
Code:
window.open(url, windowName, THEN width height, etc)

[monkey][snake] <.
 
monksnake is correct. You're script needs to look like this:

Code:
window.open('select_options.php?row=' + TestVar, 'windowname', 'toolbar=0, scrollbars=0, resizable=0, width=200, height=100');

Ron Wheeler
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top