0

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?

2 Answers2

2

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.

Alex Kellner
  • 1,263
  • 6
  • 11
1

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.

Stefan Padberg
  • 505
  • 2
  • 17
  • ok, but - if we look from another perspective - is there a possibility to manually reproduce or call the default error message that Powermail shows for empty fields and use it in my own js validation? – GodlyHedgehog Nov 27 '17 at 10:44