How to limit TextArea length (SOLVED)

Creative Contact Form is a responsive jQuery contact form with amazing visual effects. You will be surprised by count of all the possible features!
Thu Jun 08, 2017 11:01 am

  • Hi guys, today and although this is a payment complement, users besides asking for things, we also have to contribute :)

    while we wait for this improvement in the next version we can solve it this way. Is not the best way because it affects all the textarea we have, but it is valid

    We have to edit the file:

    OurWeb/components/com_creativecontactform/helpers/helper.php

    And in line 564 in the "value" section add: maxlength = "500" (for example)

    Code: Select all
    value="'.$predefined_value.'" cols="30" rows="15" maxlength="500"


    The original code is this:

    Code: Select all
    $input_html .= '<textarea class="creative_textarea creative_'.$field_type.' '.$required_classname.' creative_textarea_reset" value="'.$predefined_value.'" cols="30" rows="15" id="'.$element_id.'" name="creativecontactform_fields['.$field_index.'][0]"></textarea></div></div>';


    And the result is this:

    Code: Select all
    $input_html .= '<textarea class="creative_textarea creative_'.$field_type.' '.$required_classname.' creative_textarea_reset" value="'.$predefined_value.'" cols="30" rows="15" maxlength="500" id="'.$element_id.'" name="creativecontactform_fields['.$field_index.'][0]"></textarea></div></div>';


    Then much better if in the "Toltip text" section of fields we put something like: "Maximum 500 characters"

    Although it is a simple change, I always recommend to save the original file, for example calling it helper.php.OLD and make the modifications on a copy. then there is always back.

    I hope I have helped
    Good day to everybody :)
    rolser
     
    Posts: 3
    Joined: Thu Jun 01, 2017 2:18 pm


  • Dear Customer

    We appreciate your help!
    Thanks
    Best Regards
    Levon

    CreativeSolutions
    User avatar
    Levon
     
    Posts: 370
    Joined: Fri Jul 01, 2016 8:05 pm



Return to Creative Contact Form




Information
  • Who is online
  • Users browsing this forum: No registered users and 1 guest
cron