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>’ : ”;
​
echo (!empty(get\_field(‘form\_subheading’)))
? ‘<p>’.get\_field(‘form\_subheading’).'</p>’ : ”;
?>
</div>
​
<?php echo do\_shortcode(‘\[contact-form-7 id=”2761″ title=”Landing Page Form”\]’); ?>
​
// Validate the required form fields FIRST then ONLY go to success message below
​
<div class=”success-message”>
<?php
echo (!empty(get\_field(‘submit\_message\_heading’)))
? ‘<h2 class=”t-heading-large”>’.get\_field(‘submit\_message\_heading’).'</h2>’ : ”;
​
echo (!empty(get\_field(‘submit\_message\_paragraph’)))
? ‘<p>’.get\_field(‘submit\_message\_paragraph’).'</p>’ : ”;
?>
</div>
​
</div>
</div>
</section>
[ad_2]