Forums

Validation seems not to work with Events

monochrome 10 Dec, 2019
Hi,

i´m not 100% sure if this is a bug or i configured something wrong.

I added a checkbox with an enable/disable validation event on the following textbox.



( i tried name AND Id from the textfield as slector .. maybe here is something wrong from my side?) The textbox is configured as required but initially disabled.



On the actions tab i put an validate fields into the submit area to check it after submission.

When i test the form and click the checkbox and press submit (without filling the textfield) the Error message shortly appers under the textfield ( untill the next page is loaded) and the form redirects to the submit page.


I exspected to stay on the form page with the error message under the textfield.

Did i configure something wrong?


I added the full test-form here:[file=12477]Test_10_Dec_2019_12_12_52.cf6bak[/file]

The problems sounds similar to this older forum post but didnt solve my problem.
(https://www.chronoengine.com/forums/posts/t103450/events-and-validation-combination-not-working-properly-in-cf-v6)

Dont hesitate to ask if you need further information!


Thanks for your help,
Thorsten
healyhatman 11 Dec, 2019
That's right it doesn't work with conditionally validated fields.
monochrome 11 Dec, 2019
Hi healyhatman,

thanks for your answer.

Do you mean this is an exspected behavior or did confirm it as a bug?

Do you know any workaround to enable the validation of fields for that problem?

Thanks in advance,
Thorsten
healyhatman 11 Dec, 2019
You can either

1) exclude the conditional fields from validation, and use a series of event switches to run the remaining validations only if they're supposed to be run.
2) Validate it yourself manually with PHP
This topic is locked and no more replies can be posted.