How to prevent after click the submit button(contact page) it went straight to the “success-message” without validates the fields on the “contact-form-7”?

[ad_1]

Hello everyone, just joined this PHP Community! Need a favor if anyone can help will be awesome. I’m having a problem, how to prevent after click the submit button(contact page) it went straight to the “success-message” without validates the fields on the “contact-form-7″?

<section id=”landing-form” class=”g-flex”>

<div class=”landing-form-left”>

<?php

$gallery\_group = get\_field(‘graphs’);

$object\_fit\_remove = true;

include( locate\_template( ‘inc-comp/comp-gallery.php’, false, false ) );

?>

</div>

<div class=”landing-form-right”>

<div class=”width”>

<div class=”split-pane-right-header”>

<?php

echo (!empty(get\_field(‘form\_heading’)))

? ‘<h2 class=”t-heading-large”>’.get\_field(‘form\_heading’).'</h2>’ : ”;

&#x200B;

echo (!empty(get\_field(‘form\_subheading’)))

? ‘<p>’.get\_field(‘form\_subheading’).'</p>’ : ”;

?>

</div>

&#x200B;

<?php echo do\_shortcode(‘\[contact-form-7 id=”2761″ title=”Landing Page Form”\]’); ?>

&#x200B;

// Validate the required form fields FIRST then ONLY go to success message below

&#x200B;

<div class=”success-message”>

<?php

echo (!empty(get\_field(‘submit\_message\_heading’)))

? ‘<h2 class=”t-heading-large”>’.get\_field(‘submit\_message\_heading’).'</h2>’ : ”;

&#x200B;

echo (!empty(get\_field(‘submit\_message\_paragraph’)))

? ‘<p>’.get\_field(‘submit\_message\_paragraph’).'</p>’ : ”;

?>

</div>

&#x200B;

</div>

</div>

</section>

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer