View Full Version : Popup Window comes out as whole window

05-11-2006, 10:39 AM
I'm trying to send submitted information that has been validated via javascript onto a popup window. However the popup becomes a whole window.

I'm new to javascript and still learning the ropes. Please provide any assistance and feel free to provide advice and modifications to the code.


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<title> New Document </title>
<script type="text/javascript" language="JavaScript">
function checkContents(theForm)
if (theForm.name.value == "")
alert("Please enter a name.");
else if (theForm.weight.value == "")
alert("Please assign a weight.");

function popWindow(wName){
features =


pop = window.open('',wName,features);
if(pop.focus){ pop.focus(); }
return true;

<form name="edititem" action="popup2.php" method="post" target="Details" onSubmit="return

<input type="hidden" name ="weight" value="172">
<input type="hidden" name="name" value="John">
<!--<input type="submit" value="John">-->

<input type="button" value="Edit Item" onClick="checkContents(edititem)">


05-11-2006, 10:58 AM
However the popup becomes a whole window.As opposed to a healthy and nutritious dinner?

05-11-2006, 01:39 PM
I was hoping that the popup would be just a popup window with the settings in the javascript function, ie. a smaller sized window without the menu, etc.

what's happening is that the new window covers the old one entirely. i was hoping for a smaller window where the user can edit the data and upon submission, the data will update the info on the main(original page) and reload the info with what was edited.


05-11-2006, 02:44 PM
Well, you haven't escaped the linebreaks in the features variable. Try removing them.
Also, all variables should be declared using the "var" keyword, to avoid them being unnecessarily global.