Forums

Radio button doing wierd things

benblur4 29 Jul, 2009
When I click male or female on my form it saves to dbase as yes or no. Example: If I mark "male" then dbase shows "yes" instead of "male". What could be going on? Here is my code.
<div class="form_item">
  <div class="form_element cf_radiobutton">
    <label class="cf_label" style="width: 150px;">Sex</label>
    <div class="float_left">
      <input value="Male" title="" class="radio validate-one-required" id="radio00" name="radio0" type="radio" />
      <label for="radio00" class="radio_label">Male</label>
      <br />
      
<input value="Female" title="" class="radio validate-one-required" id="radio01" name="radio0" type="radio" />
      <label for="radio01" class="radio_label">Female</label>
      <br />
      

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


Thanks in advance!
Ben
Max_admin 29 Jul, 2009
Hi Ben, do you have any code at the onsubmit boxes ?

Regards
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
benblur4 30 Jul, 2009
I'm not sure what you mean, but I think that since I have several forms, each with several radio buttons, that they are being written over by the time they get to the table. I only have one main table for all of the forms. So, my "male" becomes "yes" from another form. So, now the question is, how do I rename the radio buttons? do I have to do this manually in the form code? If so, do they also have to be named "radio*"? "*" is for any given number. because I tried changing the name of one radio button, (i changed the name in the form data and then generated a new table) but all I got was a blank table entry.
Thanks for any help!
Ben
GreyHead 30 Jul, 2009
Hi Ben,

Do you have multiple forms on the same page? Or multiple radio button groups in the same form?

Each input should have a unique name (except for buttons in the same radio button group which can share a name).

There is nothing special about 'radio*' you can use any combination of a-z,0-9 & _ as long as the name starts with a letter.

For the data to save the name of the radio group (or any other input) needs to be exactly the same as the column name in the database table.

Bob
Max_admin 03 Aug, 2009
Hi Ben,

your radio name above is "radio0" and the values are either male or female, I'm not sure where "yes" comes from and so I was asking if there is any onsubmit code which changes this, you say its coming from another form and now I'm more puzzled! are you using the same table for another form ? does your table has a field named "radio0" ?

Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
benblur4 03 Aug, 2009
I am using multiple forms with a mother form that submits all the forms information to a single table. I generated a table that contains fields for all forms that are under the mother form.
I figured part of it out. Since Chrono forms doesn't let you rename radio buttons they were overwriting each other, because (like you said) they had the same name. Example: Form1 had a radio0 and Form2 also had a radio0. However I am still having problems. radion0-radio4 are working, but radio5-radio10 are not. Radio5-radio10 are all blank. does this make any sense?
Thanks,
Ben
GreyHead 04 Aug, 2009
Hi Ben,

Yoou can rename the buttons by editing the Form HTML. No idea about radio5-10. It' shard to understand what's happening without seeing the form. When you turn debug on so they return values in the $_POST array?

Bob
benblur4 06 Aug, 2009

Hi Ben,

Yoou can rename the buttons by editing the Form HTML. No idea about radio5-10. It' shard to understand what's happening without seeing the form. When you turn debug on so they return values in the $_POST array?

Bob


I changed some of the radios to drop-downs and now the remaining radios are working. This isn't exactly an answer to the problem but I'm ok with the radio buttons. Thanks for all the help.
This topic is locked and no more replies can be posted.