GodlyHedgehog
GodlyHedgehog

Reputation: 86

Disable validation of a field in Powermail depending on radiobutton

So the problem is as follows:

We have a Powermail 1.6.11 form in Typo3 4.5.40.

There is a radiobutton. When user selects an option, some of the mandatory fields are either shown or hidden via js. If the fields are hidden, they, of course, become unmandatory.

If I remove "required" checkbox in powermail form builder and add required attribute with js, I don't get the standard validation messages of Powermail. If I check fields as "required", I get error even if fields are hidden and html attribute is removed.

So the question is: is it possible to change the "required" status of the powermail via Typoscript depending on radiobutton value?

Upvotes: 0

Views: 1072

Answers (2)

Stefan Padberg
Stefan Padberg

Reputation: 527

If it is not possible to update your installation immidiately - what I strongly would recommend - you may add some value in the hidden required fields via your javascript. This could help you to get the form working until you will be able to update the installation.

Upvotes: 1

Alex Kellner
Alex Kellner

Reputation: 1309

No it is not possible to change the validation state of field A depending on a value of field B in your 6 years old extension version. If you would use a newer one, I would recommend powermail and powermail_cond for this task.

Upvotes: 2

Related Questions