Pass Checkboxes values to JavaScript
<p>I am declaring 5 checkbox values in myform with the name as "yourname". On clicking submit button javascript function will be called. </p>

<p>In the JS function, I need to pass this value into parent window.</p>

<p>MyHTML Code is:</p>

<pre><code>&lt;input type="checkbox" name="yourname" value="ankit"&gt;Ankit&lt;br/&gt;
&lt;input type="checkbox" name="yourname" value="rahul"&gt;Rahul&lt;br/&gt;
</code></pre>

<p>.. and more</p>

<pre><code>&lt;input type=button value='Submit' onclick="post_value();"&gt;
</code></pre>

<p>For Example, Using Below JS Code will print all values to the parent window.</p>

<pre><code>function post_value(){
    var yourname = ["ankit","rahul","vipin","abhishek"];
    alert(yourname);
    opener.document.f1.p_name.value = yourname;
    self.close();
}
</code></pre>

<p>Kindly Help,</p>
