Forums

Validation in Custom Collapsible Panels

kko 27 Jun, 2014
Hi, I'm using a bit of simple javascript to create panels in my form that open and close a set of fields. Can someone tell me how to get the closed panel to open up if there is an empty required field? Right now, the validation message shows up at the top left of the page because the panel is closed.

Here is a bit of that code used:
<a href="javascript:void(0)" onClick="$j('#optionlist').slideToggle('fast');">

<div id="optionlist" style="display:none;">


Any help is appreciated. Thank you.
GreyHead 29 Jun, 2014
Hi kko,

When the ChronoForms validator finds an error it add the class 'gvalidate_has_errors' to the input. If you check for this class inside each panel that should do what you need.

Bob
kko 30 Jun, 2014
Hi Bob,
Thanks for the response. Can you post some code samples for me? I'm afraid my coding skills aren't quite there yet.
Thanks.
This topic is locked and no more replies can be posted.