Show container after form submission failed

perissf718 19 Oct, 2025

Related to this question.

In brief: I want to set some hidden fields as "required only if shown".

In detail: I can't use the pre-built Required behavior, because it will validate even when the these fields are hidden. Hence I created a PHP Valid Function which seems to work, because it also checks the radio button value, that triggers the container's "show" property:

if ($this->data['already_subscribed'] == 'No' && !$value) {
  return "Campo obbligatorio";
}

I implemented it for the birthdate field.

The only problem is that when the validation fails, the container is hidden again, because the "on document ready" event is triggered.

Any ideas to fix? A Javascript validator? I have no idea how to get the radio button value.

Max_admin 19 Oct, 2025
Answer
1 Likes

But there is a "Disable Validation" and "Enable Validation" actions in the Listener which you can turn on or off when the trigger runs:

Show container after form submission failed image 1

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
perissf718 19 Oct, 2025
1 Likes

Yes! It works perfectly now (and it's a Javascript validator, hence the validation error is visible when required)

Radio:

Calendar field:

Max_admin 19 Oct, 2025

Glad you have it working! 😊

Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
You need to login to be able to post a reply.