Cleanstart HTML – How to enable Captcha on the Contact Form
Latest update: December 13, 2018 | Reading time: 1 to 2 minutesThere is a basic Captcha system available for the contact form in Cleanstart HTML.
It is PHP-based and does not use the Google reCaptcha system.
In order to enable the Captcha system included with our theme, please follow the steps below:
1) Edit the contact_form.js file and change the following line:
var enableCaptcha = false;
To:
var enableCaptcha = true;
2) Edit the contact.php file and change the following line:
$enableCaptcha = false;
To:
$enableCaptcha = true;
3) Edit the contact.html file and add the following snippet anywhere you want the captcha to be displayed on the form:
<!-- CAPTCHA --> <span><img src="./captcha/captcha.php"></span> <input type="text" id="captcha" /> <!-- /CAPTCHA -->
For example you can add it after the submit area:
<div class="col-sm-12 col-md-12"><br/> <a id="submit_btn" class="btn btn-primary" name="submit">Submit Message</a> <span id="notice" class="alert alert-warning alert-dismissable hidden" style="margin-left:20px;"></span> <!-- CAPTCHA --> <span><img src="./captcha/captcha.php"></span> <input type="text" id="captcha" /> <!-- /CAPTCHA --> </div>
Thank you for using Cleanstart HTML!