Forums

Radio Button Field Question

Grizzled 25 Apr, 2011
Hello,

I made a change to the radio button field name and now my form won't submit.

I have two radio button options that have a value of one. The name was called share.

But I need to have name be full or half for each button. Is this possible?

When I made the change and generated a table, it created a field name full and half. So I thought everything was OK until I tested the form and it wouldn't submit.

http://temp.modwest.com/gardencityharvest.org/index.php?option=com_chronocontact&Itemid=223

Here is the before code that worked.
<div class="form_item">
  <div class="form_element cf_radiobutton">
    <label class="cf_label" style="width: 150px;"><strong>Options*</strong></label>
    <div class="float_left">
      <input value="1" title="" class="radio validate-one-required" id="radio20" name="share" type="radio" />
      <label for="radio20" class="radio_label">Full Youth Farm CSA share $500</label>
      <br />
      
<input value="1" title="" class="radio validate-one-required" id="radio21" name="share" type="radio" />
      <label for="radio21" class="radio_label">Half Youth Farms CSA share $300</label>
      <br />
      

    </div>
    
  </div>
  <div class="cfclear"> </div>
</div>


Here is the code after I changed the name to full and half.
<div class="form_item">
  <div class="form_element cf_radiobutton">
    <label class="cf_label" style="width: 150px;"><strong>Options*</strong></label>
    <div class="float_left">
      <input value="1" title="" class="radio validate-one-required" id="radio20" name="full" type="radio" />
      <label for="radio20" class="radio_label">Full Youth Farm CSA share $500</label>
      <br />
      
<input value="1" title="" class="radio validate-one-required" id="radio21" name="half" type="radio" />
      <label for="radio21" class="radio_label">Half Youth Farms CSA share $300</label>
      <br />
      

    </div>
    
  </div>
  <div class="cfclear"> </div>
</div>


Thanks, Chuck
Grizzled 25 Apr, 2011
Here is a clue.

I had set in the wizard that one of radio buttons is required.

If I select both the buttons the form submits.

How can I have it required to select just one and have the form submit?
GreyHead 26 Apr, 2011
Hi Grizzeld,

To keep radio buttons grouped together the names *must* be the same. But the values can be different.

Bob
This topic is locked and no more replies can be posted.