Logo Logo v2.0
Image Description Image Description

No Results

  • Get Support
  • Preview Demo
Logo Logo v2.0
  • Documentation
  • Introduction
  • Getting started
  • Getting Started
  • Gulp
  • Dark Mode New
  • Customization
  • Credits
  • Changelog
  • Design & Graphics
  • Bootstrap Icons
  • Illustrations
  • Components
  • Accordion
  • Alerts
  • Avatars
  • Badge
  • Breadcrumb
  • Buttons
  • Button Group
  • Cards
  • Collapse
  • Column Divider
  • Devices
  • Divider
  • Dropdowns
  • Icons
  • List Group
  • Lists
  • Legend Indicator
  • Modal
  • Offcanvas
  • Page Header
  • Pagination
  • Popovers
  • Progress
  • Profile
  • Shapes
  • Sliding Image
  • Spinners
  • Steps
  • Tab
  • Toasts
  • Tooltips
  • Typography
  • Navbars
  • Navbar
  • Navs
  • Mega Menu
  • Navbar Vertical Aside
  • Scrollspy
  • Tables
  • Tables
  • Datatables
  • Sticky Header
  • Basic forms
  • Basic Forms
  • Checks & Switches
  • Input Group
  • Advanced Forms
  • Advanced Select
  • Datepicker (Flatpickr)
  • Date Range Picker
  • Calendar (Fullcalendar)
  • File Attachments
  • Drag’ n’ Drop File Uploads
  • WYSIWYG Editor
  • Quantity Counter
  • Copy to Clipboard
  • Input Mask
  • Step Forms (Wizards)
  • Add Field
  • Toggle Password
  • Count Characters
  • Form Search
  • Toggle Switch
  • Google reCAPTCHA
  • Charts
  • Chart.js
  • Counter
  • Circles.js (Pie Chart)
  • Others
  • Fullscreen Lightbox
  • Leaflet
  • JSVectorMap
  • SortableJS
  • Sticky Block
  • Go To
  • Utilities
  • Backgrounds
  • Borders
  • Colors
  • Links
  • Position
  • Shadows
  • Sizing
  • Spacing
  • Z-index
  • Opacity

Google reCAPTCHA

reCAPTCHA is a free service that protects your site from spam and abuse. It uses advanced risk analysis techniques to tell humans and bots apart.

reCAPTCHA documentation

How to use

  1. Log in at the Google reCAPTCHA page. If you don’t have a Google account, you will need to create one, then go back to the reCAPTCHA page
  2. You have to register a new site to let Google know which site you will be using these keys on.
  3. For the Label, enter your domain.
  4. For the Choose the type of reCAPTCHA setting, you must choose reCAPTCHA v2. This must be v2
  5. For the Domains, enter your site’s domain. If you using localhost, you can enter 127.0.0.1 or localhost.
  6. Click Register. Then, you will be presented with your reCAPTCHA keys. You will have a Site key, and a Secret key.

Copy-paste the following <script> near the end of your pages under JS Implementing Plugins to enable it.

        
          <script src="https://www.google.com/recaptcha/api.js?onload=onloadCallback&render=explicit"></script>
        
      

Copy-paste the init function under JS Plugins Init., before the closing </body> tag, to enable it.

        
          <script>
            // INITIALIZATION OF GOOGLE RECAPTCHA
            // =======================================================
            var onloadCallback = function() {
              grecaptcha.render('element (ID)', {
                'sitekey' : 'SITE_KEY',
                'theme' : 'light'
              });
            };
          </script>
        
      

Basic example

  • Preview
  • HTML
              
                <div id="googleReCaptchaBasicEg"></div>
              
            

Dark theme

Use 'theme': 'dark' prop.

  • Preview
  • HTML
              
                <div id="googleReCaptchaDarkTheme"></div>
              
            

Callback function

Use 'callback': verifyCallback (function).

  • Preview
  • HTML
  • JS
              
                <div id="googleReCaptchaCallbackFunction"></div>
              
            
              
                <script>
                  // INITIALIZATION OF GOOGLE RECAPTCHA
                  // =======================================================
                  var verifyCallback = function(response) {
                    alert('Success!');
                  };

                  var onloadCallback = function() {
                    grecaptcha.render('example1', {
                      'sitekey' : 'SITE_KEY',
                      'theme' : 'light',
                      'callback' : verifyCallback
                    });
                  };
                </script>
              
            

Modal example

  • Preview
  • HTML
Google reCAPTCHA
              
                <!-- Button trigger modal -->
                <button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#exampleModal">
                  Open modal
                </button>
                <!-- End Button trigger modal -->

                <!-- Modal -->
                <div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
                  <div class="modal-dialog">
                    <div class="modal-content">
                      <div class="modal-header">
                        <h5 class="modal-title" id="exampleModalLabel">Google reCAPTCHA</h5>
                        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                      </div>
                      <div class="modal-body">
                        <div id="googleReCaptchaModal"></div>
                      </div>
                      <div class="modal-footer">
                        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
                        <button type="button" class="btn btn-primary">Save changes</button>
                      </div>
                    </div>
                  </div>
                </div>
                <!-- End Modal -->