Add Class to form FIELD
-
I’m trying to add a class to a form field. Using the field builder popup, there is an ID and a CLASS field. ID seems to work correctly, but the class DOES NOT add a class to the field, instead it sets the NAME attribute to “class:<classname>”.
Example:
[text* class:formfirst firstname placeholder "First Name"]
produces a form field like this:
<input type="text" name="class:formfirst" value="" size="40" class="wpcf7-form-control wpcf7-text wpcf7-validates-as-required" aria-required="true" aria-invalid="false" placeholder="First Name">
Notice, that the class “formfirst” is NOT part of the class attribute, but it IS in the name attribute as “class:formfirst”, which could potentially screw up submissions. It does add a class to the parent span element, but it adds it as classformfirst instead of what I specified. Why is this behaving like this and why doesn’t it add the class to the field as one would expect?
The page I need help with: [log in to see the link]
- The topic ‘Add Class to form FIELD’ is closed to new replies.