Forums

Required field yes/no depending on checkbox

pklinke 30 Mar, 2017
Answer
Hi,

I need a field 'phone' which is required when a checkbox "Call back" is active. If 'Call back' isn't active, the field shall not required but available and can optional be filled out.

How can I do this?

Peter
GreyHead 30 Mar, 2017
Hi Peter,

I think that the only way to do that is with a Custom Validation - I'd probably add it on the phone input element.

Bob
Max_admin 30 Mar, 2017
Hi,

This feature is available in the new v6, you can install it beside v5 and give it a try.

Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
pklinke 01 Apr, 2017
Hi Max,

thank you.

I was testing V6 and this feature is available. But I do not understand, how to do the valiadation. There is only a text field and no documentation.

Peter
Max_admin 01 Apr, 2017
Hi Peter,

In v6, inside the "Checkbox" settings, under "Events", add 2 events, when "Checked", "enable validation", then use the "yes/no" field name, and when "unchecked", "disable validation", "yes/no" field name.

The "yes/no" field is what type of field ? if its a "dropdown" then in the "validation" use this:
required:This field is required

Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
pklinke 01 Apr, 2017
hi Max,

yes, this point is clear for me. But I do not understand how to validate the text field "phone". There is only a text field

Regards
Peter
Max_admin 01 Apr, 2017
In that field just write this:

required:please provide your phone number!
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
pklinke 02 Apr, 2017
Thank you,

is there a documentation available for v6?

Peter
Max_admin 02 Apr, 2017
Hi Peter,

Unfortunately not yet, because its only few days old, hopefully some docs will be available soon.

But the work flow is the same as v5, apart of some different settings.

Best regards,
Max
Max
ChronoForms developer...
Did you try ChronoMyAdmin for managing your Joomla database tables ?
This topic is locked and no more replies can be posted.