Contact Form

Tagged: 

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #1055
    Mocoblancomocoblanco
    Member

    Hi there,

    Awsome theme, and very good support forum so far. I just have a question on How to change the Contact Form.

    I want to change the “URL” box to “CITY”. So people can put the CITY when they leave a message instead of the URL. Where can I change this? and how to make a city characters valid to the form. Where is this this contact form file? I can’t find it anywhere.

    Thanks in advance.

    #1057
    Livemeshlivemesh
    Keymaster

    Pls check the file contact-shortcodes.php line number 34 in {theme directory}/framework/shortcodes/ folder (and sendmail.php in the /scripts/ folder if you need to). You can modify the file to replace URL entry with City. Not very difficult; let me know if you run into issues.

    Not sure how you would handle city validation other than telling someone that it needs at least a few characters in it. Pls check the validation for message like below in main.js file in {theme directory}/js folder –


    message: {
    required: true,
    minlength: 15
    }

    #1059
    Mocoblancomocoblanco
    Member

    Thank you very much for helping me out. I changed the .php file on line 34, and put this:

    if (mo_to_boolean($web_url))
    $output .= ‘<p><label>’ . __(‘City’, ‘mo_theme’) . ‘</label><input type=”city” name=”contact_url” placeholder=”‘. __(“Your City”, ‘mo_theme’).'” class=”text-input”></p>’;

    and then in the .js file I put this:

    contact_url: {
    required: true,
    minlength: 15
    },

    And I am getting a “validation error” message when I try to put a City on that box.

    #1075
    Livemeshlivemesh
    Keymaster

    Can you change the type=”city” to type=”text” and see if that resolves the issue? The type ‘city’ does not exist.

    Note that you should have min 15 characters (as per the code above) for city which can be a bit high if someone is inputting city name.

    Pls email me the url and I can take care of this if you still have issues. Thanks

    #1095
    Mocoblancomocoblanco
    Member

    I change the min characters. That was the problem.

    Thank you very much for the support.

    Best,
    Moco

    #1098
    Livemeshlivemesh
    Keymaster

    Great. Thanks for letting me know.

    #1434
    Elaineelaine
    Member

    I have a similar question relating to the contact form as I want to change the text in the form fields. (i.e. from ‘Your message for us’ to ‘Your message’)

    From the posts above, I can see where to edit this in the contact-shortcodes.php file. To avoid editing the original theme files, can this be done via a child theme?

    Also, is it possible to have this text as lowercase? Where can I find the setting for this?

    Thanks.

    #1464
    Livemeshlivemesh
    Keymaster

    If you come up with a child theme, instead of modifying the original shortcode, pls copy the shortcode from the contact-shortcodes.php file and create a new shortcode with a changed name like “custom_contact_form” like this (modify the method name too) in the functions.php of the child theme –

    function mo_child_contact_form_shortcode($atts, $content = null, $code) {
        extract(shortcode_atts(array(
            'class' => '',
            'mail_to' => '',
    
        ......
       
        $output .= '';
    
        $output .= '';
    
        return $output;
    
    }
    
    add_shortcode('custom_contact_form', 'mo_child_contact_form_shortcode');
    

    Then you can use the new shortcode [custom_contact_form] in your pages. You can also remove the old shortcode using remove_shortcode() function and reuse the shortcode name ‘contact_form’ but hope the above change is simple enough to meet your needs.

    You can change the case of the placeholder label by pasting the below CSS in the Custom CSS tab of options panel or in the style.css of the child theme –

    ::-webkit-input-placeholder { text-transform: none; font-style: italic; }
    ::-moz-placeholder { /* Firefox 19+ */ text-transform: none; font-style: italic; }
    :-ms-input-placeholder { text-transform: none; font-style: italic; }
    
    #1468
    Elaineelaine
    Member

    sorry, you lost me there, which file do I put that block of code in?

    in the functions.php file, there is no reference to the contact_form shortcode?

    #1471
    Livemeshlivemesh
    Keymaster

    I thought you said you wanted the change to be in the child theme. When you create a child theme, you can create a functions.php file which will have the piece of code I refer to above. You copy the contents of the file contact-shortcodes.php into functions.php of the child theme ( not the parent theme). Thanks

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.