Validation rule not being called in alternative form

Brendan Finnegan asked on September 9, 2016 00:39

Hi,

I have an advanced form that will show/hide data depending on the value of a drop down list in a E-Commerce checkout process. A user can select addition people to have on their plan from a drop down list. By default, all of these fields are hidden based on some javascript I wrote.

My problem comes when validating the hidden fields that become visible. I added a validation rule as per this article https://devnet.kentico.com/articles/tweaking-kentico-(1)-hidden-required-fields, but my validation rules are always ignored.

My custom macros were not being hit so I tested using the built in rule designer with validation I know would not be met. For example if the day of the week was Sunday (it's Thursday today when I'm testing), the minimum length can only be one (leaving an empty string), or even the Current month is January. None of the validation rules hit and my form continues. Is there something I need to set to check for validation rules?

Brendan

Recent Answers


Brenden Kehren answered on September 9, 2016 05:19

Your title states you're using an alternative form. Did you copy the rule over to the alternative form from the main field definition? I'm not looking right now but I'm not 100% positive the validation rules transfer from one form to another. You might want to verify and test that.

0 votesVote for this answer Mark as a Correct answer

Brendan Finnegan answered on September 9, 2016 17:27

Hi Brenden

I will give that a shot. I did not write the rule in both forms.

There is a spot for validation rules on the alternative form on both the main field and the field definition on the alternative form. I'll see if that changes anything.

Thanks Brendan

0 votesVote for this answer Mark as a Correct answer

Brendan Finnegan answered on September 12, 2016 19:13

Hi Brenden,

That did not work. I set both validation rules on the alternative form and main field as the same validation (Current month is January) and my validation was still ignored.

Do you have any other suggestions I can try?

Brendan

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.