Tagged: characters, CONTACT FORM
Hi all,
can somebody tell me, where I can limit the number of characters allowed in the contact form fields, in particular the text area? Couldn’t find a hint in the documentation…
Thanks for your help!
Hey tjoerger,
The textarea in the contact form doesn’t have a maxlength attribute so it should be unlimited based on https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea
maxlength
The maximum number of characters (unicode code points) that the user can enter. If this value isn’t specified, the user can enter an unlimited number of characters.
I hope this helps.
Best regards,
Nikko
Hi Nikko,
thank you, that’s what I thought. My question is where I can find the respective file in enfold in order to add the “maxlength” attribute.
Thanks,
Thomas
Hi Thomas,
I see, you can find it in wp-content > themes > enfold > framework > php > class-form-generator.php and look for this code (line 683 in Enfold 4.5.7):
$this->elements_html .= ' <textarea '.$placeholder.' name="'.$id.'" class="text_area '.$element_class.'" cols="40" rows="7" id="'.$id.'" >'.$value.'</textarea>';
Best regards,
Nikko
Thank you, Nikko, found it with your help.
Best regards,
Thomas
Hi Thomas,
Great! We’re glad that we could help :)
Thanks for using Enfold and have a great day!
Best regards,
Nikko