Fetchify Documentation
Fetchify
Sign Up
Contact
Fetchify
Sign Up
Contact
  • Getting Started
  • Integrations

    • BigCommerce
    • CS-Cart
    • Ecommerce Templates
    • EKM
    • Formstack
    • Magento 2
    • Microsoft Dynamics 365
    • NetSuite
    • nopCommerce
    • Odoo
    • OpenCart
    • osCommerce
    • PrestaShop
    • Salesforce
    • Shopify Plus
    • Shopware
    • VirtueMart
    • WooCommerce
    • Xero
    • Zen Cart
    • Zapier
    • Zoey
  • Browser Extension

    • Chrome Browser Extension Guide
    • Firefox Browser Extension Guide
  • JavaScript Library

    • Address Auto-Complete
    • UK Postcode Lookup
    • Phone Validation
    • Email Validation
    • Bank Validation
    • Tutorials

      • Address Auto-Complete Website Integration
      • Customising Address Auto-Complete
      • Address Auto-Complete On Two Forms
      • UK Postcode Lookup in 15 Minutes
      • UK Postcode Lookup On Two Forms (Billing & Shipping)
      • Using Address Auto-Complete in React
      • Using Address Auto-Complete in Vue
    • Sample Code

      • Client Side JavaScript Address Auto-Complete
      • JavaScript & HTML – Client Side Postcode Lookup
  • Address & Validation API

    • Address Auto-Complete
    • Phone Validation API
    • Email Validation API
    • Bank Validation API
  • UK Postcode Lookup API

    • UK Postcode Lookup
    • UK Postcode Lookup (XML)
    • UK Postcode Geocodes
    • Errors
    • Sample Code

      • Microsoft C# Wrapper
      • Microsoft C++ Example Application
      • JSON API integration with jQuery UI
      • PHP – Server Side UK Postcode Lookup
      • Python – UK Postcode Lookup Example
      • RealStudio/XOJO Example
      • Microsoft VB.Net Sample Code
  • Embedded Tech API

    • Embedded Tech API
  • End-of-Life Announcements

    • Plugins & Extensions

Email Validation

For any integration, there are two pieces of JavaScript that you need: our JavaScript library and some configuration code. See the tutorial for more details on how to add this code to the page containing your address form.

JavaScript Library

Link to the JavaScript library:

<script src="https://cc-cdn.com/generic/scripts/v1/cc_c2a.min.js"></script>

There are two options for adding the JavaScript library:

Firstly, we host the final, compacted code on a CDN. This means that to add the JavaScript library to your page, you simply need to include this link. We recommend that you use this option, as you will automatically receive updates and bug fixes. However, if you use subresource integrity checks, these will fail after an update.

Alternatively, you can download the JavaScript and host it on your own server. You can download the package here from Github.

Setup

The first step is to initialize the library and complete a setup, so that you can add forms to it.

window.cc_c2a = new clickToAddress({
	accessToken: 'xxxxx-xxxxx-xxxxx-xxxxx' // Replace this with your access token
})

Tips

This call can only be performed once on every page; please call it only once during page load.

Add Email Validation

Adding email validation is now quite simple, simply let the library know that there's a new form to be validated.

window.cc_c2a.addEmailVerify({
	email: '#email',
	allow_high_risk: false
});
KeyTypeRequiredDescription
emailstring✔️The field that you want to validate. Accepts a valid query selector, the id of a field or an HTML element.
allow_high_riskbooleanDefault: false
Switching this feature to false will make the library reject disposable email addresses.

Warning

Some of the largest email provides have malicious actors who run email services on domains with typos. For example, for Gmail, gmil.com and gmai.com run services. (probably for scamming purposes) In general, we suggest leaving the allow_high_risk on false.

Remove Email Validation

You can remove email validation from any field using the .removeEmailVerify() function. Accepts a valid query selector, the ID of a field, or an HTML element.

window.cc_c2a.removeEmailVerify('#email');
Prev
Phone Validation
Next
Bank Validation