onClick and window.location.href using Javascript
<p>I have a form submit based on the URL parameters. Now, before submitting the form, I also wanted to get a choice from the user and using a popup window for that.</p>

<pre><code>&lt;input type="image" name="btnAddToCart" src="&lt;?php echo $pd_thumbnail;?&gt;" onClick="popupwindow('include/option.php?pid=&lt;?=$pd_id?&gt;','Choice', '200','200');" window.location.href='&lt;?php echo $cart_url; ?&gt;';" class="addToCartButton"&gt;
</code></pre>

<p>With this code, I am not able to use the window.location.href and my url is not refreshing.</p>

<pre><code>&lt;input id="details_&lt;?=$pd_id?&gt;" name="details_&lt;?=$pd_id?&gt;"&gt;
</code></pre>

<p>In the URL, I also wanted to pass the value of above input which is coming from the popup window option.php.</p>

<pre><code>&lt;head&gt;
&lt;? $pid=$_GET['pid'] ?&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;SCRIPT LANGUAGE="JavaScript"&gt;
&lt;!-- Begin
function sendValue(val){
window.opener.document.getElementById('details_&lt;?=$pid?&gt;').value = val;
window.close();
}

//  End --&gt;
&lt;/script&gt;
&lt;form name="selectform"&gt;
    &lt;?=$pid?&gt;
    &lt;input id="1" name="details_&lt;?=$pid?&gt;" value="option1" type="radio" onClick="sendValue(this.value);"&gt;option1&lt;br&gt;
    &lt;input id="1" name="details_&lt;?=$pid?&gt;" value="option2" type="radio"onClick="sendValue(this.value);"&gt;option2&lt;br&gt;
            &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
