Conditional required fields

How to make form fields conditionally required based on user selection.

Overview

The issue occurs when hidden fields that are marked as required prevent form submission because they cannot be filled.
Disable validation for those fields using a listener, which prevents the validation check during submission.

Answered
ChronoForms v8
kr kraadde 12 Feb, 2025

Is there a possibility to set a field conditionally as required?

Max_admin Max_admin 13 Feb, 2025

what are you trying to do ?

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
kr kraadde 13 Feb, 2025

Max, I have a form with many fields that are set as required. some of them are hidden (or shown), depending on  a dropdown selection.

Whenever they are hidden, of course the user will not fill them. As a result, submitting will not be possible and an error message will appear.

Have you a solution advise for that?

Regards

Max_admin Max_admin 13 Feb, 2025
Answer

Just disable the fields validation with a listener:

Conditional required fields image 1

in this case the field validation after submit will NOT be processed

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.