Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating an event when closing a window using Javascript
    primarykey
    data
    text
    <p>I'm creating a popup that will allow me to select values from it, then after I've selected the values, I need to close the window, then pass it to my main form. </p> <p>The code in my main form:</p> <pre><code>onClick="cust=window.open('popup.php?count=&lt;?=$RowStart?&gt;&amp;name_id=' + document.form1.name_id&lt;?=$RowStart?&gt;.value'custWindow','top=50, left=50, height=150, width=375, scrollbars=yes, resizable=yes');cust.focus();); </code></pre> <p>And the code inside the popup:</p> <pre><code>&lt;form name="form1" action="&lt;?=$_SERVER['PHP_SELF']?&gt;" method="post"&gt; &lt;table width="100%" border="0" cellpadding="0" cellspacing="0"&gt; &lt;tr&gt; &lt;td&gt; &lt;input id="name" name="name" type="text"/&gt; &lt;input id="nameid" name="nameid" type="hidden" value ="&lt;?=$name_id?&gt;"/&gt; &lt;/td&gt; &lt;td&gt; &lt;input name="ellipse" type="button" value="..." onClick="ellipse=window.open('engine_item_list2.php?name='+document.form1.name.value,'ellipse','top=50,left=50,width=500,height=500, scrollbars=yes, resizable=yes'); ellipse.focus();"/&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; </code></pre> <p>What happens is when I click the button in the main form, it goes to open a new window where the popup has a form. Inside the form is an ellipse that gets the value for the name_id using the input from the name textfield. </p> <p>I am able to get the values from the ellipse to the name_id, because the ellipse has a submit button inside it. But my popup window form1 should not have a save button involved, so I have to pass the values from the popup window back to the main form by either submitting it when I close the popup or using another way.</p> <p>I think I should use a window.close() but I dont know how to pass the data back using it. Is there a way I can link the close button in the window such that when it gets clicked the values gets to be passed back to the main form?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload