Check Box Question, Required Field

Grizzled 13 Feb, 2012
Hello, I am working with Garden City Harvest here in Missoula, Montana. They run all our community gardens and CSA's.

We have a form for filling for CSA Shares.

We have a text box on the form for

Full Share
Half Share
Winter Share

Each of these text box goes into tables in the database called Full, Half, and Winter for export into excel.

The problem is we want to have this grouping be a required field. But technically they are seperate fields. Is there any way to group them in a wrapper and make them select one? And then also keep them in seperate tables in the database?

Thanks, Chuck
GreyHead 14 Feb, 2012
Hi Chuck,

Which version of ChronoForms are you using? You can find the version from Site Admin | Extensions | Install/Uninstall | Components in Joomla! 1.5 or Site Admin | Extensions | Extension Manager | Manage in Joomla! 1.6/1.7/2.5.

This sounds to me like a case for checkboxes (if more than one is allowed) or radio buttons (if only one is allowed). That makes the validation easy.

The Formcheck library that ChronoForms v4 uses doesn't have a built in function for this but I guess it would be possible to build a custom one.

Bob
Grizzled 15 Feb, 2012
Hi,
Apologies for not posting the version.

We are using Joomla 1.5 and Chronoforms 3.1 RC5.5.

If this requires custom coding, we can live with the way it is. We just bolded the Please Select One in red to scare them into making a choice:)

If there is an easy way to group them with a checkbox and then have each, checked box go into it's own table that would be great.

Thanks, Chuck
GreyHead 22 Feb, 2012
Hi Grizzled,

With CFv3.1 I think the easiest way to do this would be to put the values in a Checkbox array in the form - that will let the validation work OK. Then after the form is submittes use the OnSubmit before Email box to add a code snippet to read the results and create three new variables to be saved into the database.

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