Home Forums Porto Template Porto Contact Form

This topic contains 9 replies, has 2 voices, and was last updated by  Support 4 years, 6 months ago. This post has been viewed 5686 times

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #10004617

    tcanani
    Participant

    Hello,

    I am having some issues with customization of the contact form and i would like some help to solve it, so i can put my new site in production.

    First help i need is to change or add the fields. For instance, i need in the contact form the fields: Name, Surname, Email, Phone, and the message itself. I don’t need any subject informed, but there can be a fixed subject in the email sent for identification purposes, such as “:: Website Contact::”. All fields are required.

    I can change the form itself, but it seems that i’m missing code change in the background .php files. I tried some modification but still couldn’t gather the information to provide in the email.

    Other issue is regarding the captcha verification. When not informed it reminds the need to, but you can put anything in the box and it’s validated.

    And at last (!) I want to put the same contact form on a modal popup window on my home page. How can i do it? Can i use the same form?

    Thank you in advance, i’ll be waiting for your response so we can go on with this…


    #10004627

    Support
    Keymaster

    Hello, here are some instructions on how the basic contact form works:

    The basic contact-form is basically divided in 3 parts.

    1) HTML (contact-us.html)

    As you can see, you need to set different IDs for the items marked in the screenshot for each form that you will add.

    2) JS (js/views/view.contact.js)

    In the JS you need to set those ids and set the “data” object, with all the fields values that you want to send to the email.

    3) PHP (php/contact-form.php)

    In that file, you need to set the email and the values.

    4) For the subject, you can just set one in the php file:

    Let me know if you have any questions.

    Thanks.


    #10004647

    tcanani
    Participant

    Hi there!

    Thanks for the reply. After reading your explanation i was able to add the fields i wanted into the email!

    Although, to make the captcha works, i had to use the advanced form. So i customized it and now the captcha is being validated… yeah!

    However, now i’m having this error when trying to send the email:

    Erro! Ocorreu um erro ao enviar sua mensagem. (SMTP Error: The following recipients failed: tcanani@gmail.com)

    Tcanani@gmail.com is the email i’ve configured to be receipt of the form info. What could be going wrong now. And other detail, i want in the email header to have the name and lastname (a separate form filed i’ve added) and i can’t make it work properly, with spaces. It shows like this “ThiagoCanani <123123@sadasdad>” and should be “Thiago Canani <123123@sadasdad>”. In the code i’ve managed to add the lastname filed like this $_POST[‘name’][‘lastname’] but i should have a blank space beetween the fields right? Is it possible?

    Thanks again… i’ll keep waiting!


    #10004657

    Support
    Keymaster

    Hello, ok, fine.

    1) To make the phpMailer to work using gmail you need to set the authentication mode (Step 4 of the PHP file), here you can find more information regarding which port number, secure settings, etc: http://phpmailer.worxware.com/?pg=examplebgmail

    2) For the name with the space you can set it like this: $_POST['name'] . ' ' . $_POST['lastname']

    Let me know if you have any questions.

    Thanks.


    #10004729

    tcanani
    Participant

    Hi again…

    Just to say that the forms are going alright! Everything is working and now it’s just about the details…

    As i told you in the previous post, i have two contact forms. Well, actually it’s only one, but in two different locations. One is located in the contact page and is working fine. The second i putted on a modal window, and is working fine too. The only issue is that when the info is sent, the modal window closes and don’t show the confirmation text. If i open the modal window again the confirmation text is there, but i was thinking about, as i press the send button, how can i show the green confirmation text on a second modal window just for this propose?


    #10004741

    Support
    Keymaster

    Hello, please send me the URL so I can check. Thanks.


    #10004742

    tcanani
    Participant

    Ok. The site is at http://www.derosebelavista.org/ccbv

    Thanks!


    #10004746

    Support
    Keymaster

    Hello, OK, I thought you’re using the basic contact form, so if you’re using the advanced one, you can just put the PHP script that sends the message at the top of the file (same way as the file contact-form-advanced.php) and then put the message where you want to show that (outside the modal):

    So when the page loads after you submit the form, the message will be there in the main content.

    Let me know if you have any questions.

    Thanks.


    #10004751

    tcanani
    Participant

    Actually, i’m using the advanced form in the modal, the same form i’m using in the contact page. The php code is at the beginning of the file. The thing is how to make the confirmation message appear on other modal window automatically after clicking in the send button. Imagine that you have clicked the modal button to open the window with the form. You fill the fields with the info and send it. Now, the window closes and you don’t know if it worked. If you click again to open the modal window with the form, the form is empty and the confirmation message is there. What i’m thinking is to automatically after the window closes, another one opens just with these confirmation message, you know?


    #10004757

    Support
    Keymaster

    Hello, OK, please add this:

    (js/custom.js)

    $(document).ready(function() {
    	if($('#myModal #contactSuccess').get(0) || $('#myModal #contactError').get(0)) {
    		$('#contactFormAdvanced').hide();
    		$('#myModal').modal('show');
    	}
    });

    Let me know if you have any questions.

    Thanks.


Viewing 10 posts - 1 through 10 (of 10 total)