Hi,
I am having a problem, I need you input/help.
I am creating a form, the form have several sections which hide and show on selecting an option from a dropdown.
So I have created several divs for each section and by default they are all hidden. Now on selecting the option from dropdwon, I show the respective div.
Now this each div ( section) has 2 fields that need to be validated as required. I can't add validation class ( class = "validate['required']" ) by default, so I am adding them dynamically using jquery to fields inside the selected section. But this validation don't work. but i add by default they work.
So there is something that also need o be added beforehand. Can you please help me in this.
For an example
drop down options are = P1, P2, P3, P4
Now we select P1 and the P1 div is shown, now it has 1 field textarea ( description ). I want to validate that as required. But If the user selects p2 than the above textarea won't be validated but the another textarea will be validated.
Thanks in Advance.
I am having a problem, I need you input/help.
I am creating a form, the form have several sections which hide and show on selecting an option from a dropdown.
So I have created several divs for each section and by default they are all hidden. Now on selecting the option from dropdwon, I show the respective div.
Now this each div ( section) has 2 fields that need to be validated as required. I can't add validation class ( class = "validate['required']" ) by default, so I am adding them dynamically using jquery to fields inside the selected section. But this validation don't work. but i add by default they work.
So there is something that also need o be added beforehand. Can you please help me in this.
For an example
drop down options are = P1, P2, P3, P4
Now we select P1 and the P1 div is shown, now it has 1 field textarea ( description ). I want to validate that as required. But If the user selects p2 than the above textarea won't be validated but the another textarea will be validated.
Thanks in Advance.
Hi dotjoomla,
In ChronoForms v4 set the validation as you would for a normal input. Then disable the input when you hide it and re-enable it when you show it again. Then the validation will work OK.
I also clear any inputs that are being hidden.
Bob
In ChronoForms v4 set the validation as you would for a normal input. Then disable the input when you hide it and re-enable it when you show it again. Then the validation will work OK.
I also clear any inputs that are being hidden.
Bob
This topic is locked and no more replies can be posted.