I have a very long form that I need people to fill in. It’s problematic when a part of the 40+ fields in the form doesn’t validate and takes you to the top of the document with some relatively cryptic messages as to which input field didn’t validate.
Is there a way to highlight the actual label/input field so that it’s easy to see what’s wrong at a glance?
Cheers!
-
☆ A M B ☆
- 24,524 Posts
You can have eForm add a classname to the offending element, and have that styled in your CSS. You can also use some javascript to gather up an array of all the form elements with that classname, and give the first one the focus.
&requiredClass (optional)
Css class name. Will add class in (empty) required form fields on validation. Existing classes will be preserved.
If you have already set a class for a field or label and you get unexpected css results check the order in which you have declared the classes. The &requiredClass is added to the beginning of any classes already set.
That’s the one! Thanks very much Susan.
About to try your Vanilla 2 forum tutorial also - thanks for your amazing contributions!
-
☆ A M B ☆
- 24,524 Posts
Vanilla has progressed since then; make sure to check out their latest version and documentation.