Make my Billing and Shipping Fields Match
<p>I want to make my Billing fields automatically match my Shipping fields. I can make it work  with text values, but I can't automatically populate a RADIO BUTTON. I'm using this code: <a href="http://jsfiddle.net/aDNH7/" rel="nofollow">http://jsfiddle.net/aDNH7/</a> I would like to keep this in Javascript.</p>

<pre><code>&lt;script&gt;
function FillBilling(f) {
  if(f.billingtoo.checked == true) {
    f.billingname.value = f.shippingname.value;
    f.billingcity.value = f.shippingcity.value;
  }
    if(f.billingtoo.checked == false) {
    f.billingname.value = '';
    f.billingcity.value = '';
  }
}
&lt;/script&gt;
&lt;td bgcolor="eeeeee"&gt;
&lt;b&gt;Mailing Address&lt;/b&gt;
&lt;br&gt;&lt;br&gt;
&lt;form&gt;
Name:
&lt;input type="text" name="shippingname"&gt;
&lt;br&gt;
City:
&lt;input type="text" name="shippingcity"&gt;
</code></pre>

<p><br>

        />
        Checking
      <br />
      
        />
        Savings</p>

<pre><code>&lt;br&gt;
&lt;input type="checkbox" onclick="FillBilling(this.form)" name="billingtoo"&gt;
&lt;em&gt;Check this box if Billing Address and Mailing Address are the same.&lt;/em&gt;
&lt;p&gt;
&lt;b&gt;Billing Address&lt;/b&gt;
&lt;br&gt;&lt;br&gt;
Name:
&lt;input type="text" name="billingname"&gt;
&lt;br&gt;
City:
&lt;input type="text" name="billingcity"&gt;
</code></pre>

<p><br>

        />
        Checking
      <br />
      
        />
        Savings
    </p>
    ​</p>

<pre><code>BUT, I want to add this to the form for both the BILLING and SHIPPING. And then I want the SHIPPING one to match up with the BILLING one if I check the box.

&lt;!-- &lt;td colspan="2"&gt;&lt;p&gt;
  &lt;label&gt;
    &lt;input type="radio" name="acct" value="checking" id="acct_0" &lt;?php if ($user_info['acct'] == "checking"){ echo "checked='checked'"; }?&gt;/&gt;
    Checking&lt;/label&gt;
  &lt;br /&gt;
  &lt;label&gt;
    &lt;input type="radio" name="acct" value="savings" id="acct_1" &lt;?php if ($user_info['acct'] == "savings"){ echo "checked='checked'"; }?&gt;/&gt;
    Savings&lt;/label&gt;
  &lt;br /&gt;
&lt;/p&gt;
&lt;/td&gt;--&gt;
</code></pre>
