Forums

How to Post checkbox and radio choices

johnlanglois 26 Jan, 2010
I seem to be having luck posting text fields with names to the table I set up for this form.
How do I get the values for checkboxes and radio buttons?

The wizard editor doesn't offer a name, although I have surmised from the emails that they are radio1, radio2, etc.
GreyHead 26 Jan, 2010
Hi johnlanglois,

There's nothing special - except to set ChronoForms to handle array data on the form General tab. Then they should be just like any other data.

Bob
johnlanglois 26 Jan, 2010
I am not sure that I understand the correspondence that needs to occur.
It appears that if I have the same field name in the form that I do in the underlying table that the data gets posted. However, the radio buttons do have a place to put a field name.

Here is what I have in my DB connection.

check0,chp_state,chp_name,chp_leader,chp_phone,chp_fax,chp_email,chp_address,chp_city,chp_state_location,chp_zip,radio1,radio2,radio3,radio4

Surely the order must matter. Do I need to put any fields that occur in between the buttons to maintain the field order integrity?
GreyHead 26 Jan, 2010
Hi johnlanglois,

The field order is inconsequential.

However, the radio buttons do have a place to put a field name.

Do you mean 'do *not* have a place'??

Yes they surely do - every input is required to have a name attribute. Typically for a radio button group you use the same name for all the members as only one will return a value, and for a checkbox group you use the same array name e.g. name='my_checkboxes[]'.

Bob
manishjhawar 24 Feb, 2010

However, the radio buttons do have a place to put a field name.



This is correct. The radio buttons and check boxes lack the Field Name property and default to radioN and checkM respectively as the name attribute for their INPUT tag.

Could you provide a patch or hints to add field names for them. I am using ChronoForms_V3.1_RC5.5

Thanks in advance.

Manish
GreyHead 24 Feb, 2010
Hi Manish.

Ah, I understand now, there is nothing in the Form Wizard or Wizard Edit, that is correct. But you can edit anything in the Form HTML by using the Form Editor.

Bob
manishjhawar 24 Feb, 2010
Hi Bob,

Thanks for your quick reply.

Your're right on the workaround. But I guess that its a case of mising functionality and could be corrected in the next release.

BTW, I used another workaround by creating a "Wizard Custom Element" for my radio button needs. Works beautifully.

Thanks for a wonderful extension.

Regards,

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