Reputation: 1454
I defined a custom validator which works as expected when the form field ist filled with a value. But when the form field is left empty the custom validator is not called and the field is not validated.
When i additionally activate the option "mandatory" I could prevent that the form is sent with an empty value but this is not possible in my case because the field must not be mandatory.
More precisely:
Checkbox Newsletter: when not checked the field "email" is not needed and therefore not mandatory. When checked the field "email" is needed and should therefore be mandatory and validated by my custom validator which checks if the address is in the database already.
My Question:
Upvotes: 0
Views: 412
Reputation: 1
You could try powermail_cond. This extension enables you to show or hide fields depending on the state of other form fields. So you would create a second field "email" without validation and mandatory flag. Then via powermail_cond you create the following rules
This should work with powermail_cond 7.4.
Upvotes: 0