Hi -
I have 3 fields on my form which are related. All three are "watched" by a fourth element which determines the options presented in this fourth elements dropdown menu. If a validation error occurs on my first element (for example, the user leaves it blank, or in my case fills it in but then deletes it before submitting the form), I reset the second and third elements when the form reloads as they depend on the value of the first element.
When the form is submitted, the validation detects the empty first element and correctly highlights it in red, as it fails the validation, however the second and third elements which I reset are not highlighted with the red validation message.
My question is how can I apply the failed validation class to the 2nd and 3rd element, which I reset through my code, so that the user sees the red highlight text for all 3 elements and know they must re-enter all 3?
Thanks.
I have 3 fields on my form which are related. All three are "watched" by a fourth element which determines the options presented in this fourth elements dropdown menu. If a validation error occurs on my first element (for example, the user leaves it blank, or in my case fills it in but then deletes it before submitting the form), I reset the second and third elements when the form reloads as they depend on the value of the first element.
When the form is submitted, the validation detects the empty first element and correctly highlights it in red, as it fails the validation, however the second and third elements which I reset are not highlighted with the red validation message.
My question is how can I apply the failed validation class to the 2nd and 3rd element, which I reset through my code, so that the user sees the red highlight text for all 3 elements and know they must re-enter all 3?
Thanks.