Home Forums Porto Template Forms not working properly

This topic contains 5 replies, has 2 voices, and was last updated by  Support2 5 days, 20 hours ago. This post has been viewed 48 times

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #10023769

    hmoralev
    Participant

    Have 2 issues with contact forms:
    1. On the contact page, when sending a message, the page displays “Error! There was an error sending your message.” But the message is sent/received by me.
    2. On internal pages, such as onlinesurvival.net/web6/web-design-los-angeles.html (at the bottom), the button to pull the form out works but the mail is not sent. No error messages and no other messages, it just reloads the page.
    NOTE: the contact form was not working before, but then changed the setting on “contact-form.php’ to “$debug = 2” and it works in terms of sending the email but then the page displays the error as described.


    #10023773

    Support2
    Keymaster

    Hello,

    1) If you are receiving the emails, the only possible issue is the value of $debug. Set the value to $debug = 0;.

    2) Change the HTML of popup button to:

    <a class="popup-with-form btn btn-tertiary" href="#contactForm">Click to open Contact Form</a>

    Change the HTML of form to:

    <!-- Form -->
    <form id="contactForm" class="white-popup-block mfp-hide" action="php/contact-form.php" method="POST">
    	<div class="alert alert-success d-none mt-4" id="contactSuccess">
    		<strong>Success!</strong> Your message has been sent to us.
    	</div>
    
    	<div class="alert alert-danger d-none mt-4" id="contactError">
    		<strong>Error!</strong> There was an error sending your message.
    		<span class="text-1 mt-2 d-block" id="mailErrorMessage"></span>
    	</div>
    	<div class="form-row">
    		<div class="form-group col-lg-6">
    			<label>Name *</label>
    			<input type="text" value="" data-msg-required="Please enter your name." maxlength="100" class="form-control" name="name" id="name" required>
    		</div>
    		<div class="form-group col-lg-6">
    			<label>E-Mail *</label>
    			<input type="email" value="" data-msg-required="Please enter your email address." data-msg-email="Please enter a valid email address." maxlength="100" class="form-control" name="email" id="email" required>
    		</div>
    	</div>
    	<div class="form-row">
    		<div class="form-group col">
    			<label>Subject</label>
    			<input type="text" value="" data-msg-required="Please enter the subject." maxlength="100" class="form-control" name="subject" id="subject" required>
    		</div>
    	</div>
    	<div class="form-row">
    		<div class="form-group col">
    			<label>Message *</label>
    			<textarea maxlength="5000" data-msg-required="Please enter your message." rows="10" class="form-control" name="message" id="message" required></textarea>
    		</div>
    	</div>
    	<div class="form-row">
    		<div class="form-group col">
    			<input type="submit" value="Send Message" class="btn btn-primary btn-lg" data-loading-text="Loading...">
    		</div>
    	</div>
    </form>

    Add the script “view.contact.js” on footer, like the image below:

    <script src="js/views/view.contact.js"></script>

    Please, try that and let me know if you need further assistance.

    Kind Regards,

    Rodrigo.


    #10023777

    hmoralev
    Participant

    Hi Rodrigo,

    Thank you for your reply. Did changes as suggested but now both forms disappeared. Yeah, I know sounds weird.

    Changes:
    1. Changed pop-up line as you described: now the forms are not shown. Samples are here: onlinesurvival.net/web6/web-design-los-angeles.html |and| onlinesurvival.net/web6/online-marketing.html
    2. Changed contact form as suggested and added script at the bottom: form is not coming up/being shown. Sample: onlinesurvival.net/web6/contact.html

    Please review and advise.

    Regards,
    Hector


    #10023781

    Support2
    Keymaster

    Hello Hector,

    You should apply the solution that i sent for you only on the page “onlinesurvival.net/web6/web-design-los-angeles.html”.
    The contact page was ok and working, you should have just changed the variable $debug to not show the error message anymore. Please back to the old HTML code and will works.

    Regarding the internal page (onlinesurvival.net/web6/web-design-los-angeles.htm), it’s missing you change the HTML of form like the step 2 in my previous solution:

    <!-- Form -->
    <form id="contactForm" class="white-popup-block mfp-hide" action="php/contact-form.php" method="POST">
    	<div class="alert alert-success d-none mt-4" id="contactSuccess">
    		<strong>Success!</strong> Your message has been sent to us.
    	</div>
    
    	<div class="alert alert-danger d-none mt-4" id="contactError">
    		<strong>Error!</strong> There was an error sending your message.
    		<span class="text-1 mt-2 d-block" id="mailErrorMessage"></span>
    	</div>
    	<div class="form-row">
    		<div class="form-group col-lg-6">
    			<label>Name *</label>
    			<input type="text" value="" data-msg-required="Please enter your name." maxlength="100" class="form-control" name="name" id="name" required>
    		</div>
    		<div class="form-group col-lg-6">
    			<label>E-Mail *</label>
    			<input type="email" value="" data-msg-required="Please enter your email address." data-msg-email="Please enter a valid email address." maxlength="100" class="form-control" name="email" id="email" required>
    		</div>
    	</div>
    	<div class="form-row">
    		<div class="form-group col">
    			<label>Subject</label>
    			<input type="text" value="" data-msg-required="Please enter the subject." maxlength="100" class="form-control" name="subject" id="subject" required>
    		</div>
    	</div>
    	<div class="form-row">
    		<div class="form-group col">
    			<label>Message *</label>
    			<textarea maxlength="5000" data-msg-required="Please enter your message." rows="10" class="form-control" name="message" id="message" required></textarea>
    		</div>
    	</div>
    	<div class="form-row">
    		<div class="form-group col">
    			<input type="submit" value="Send Message" class="btn btn-primary btn-lg" data-loading-text="Loading...">
    		</div>
    	</div>
    </form>

    Please, try that and let me know if you need further assistance.

    Kind Regards,

    Rodrigo.


    #10023795

    hmoralev
    Participant

    Hi Rodrigo,

    Now I see what you mean. Yep, all working good now.Thanks a lot man!

    Best,
    Hector


    #10023800

    Support2
    Keymaster

    Hi Hector,

    Great 🙂

    If you need further assistance, please contact us.

    Kind Regards,

    Rodrigo.


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