title: Check for existing email in WooCommerce checkout using Ajax
body: <p>I'm trying to check inserted value for billing_email field in WooCommerce checkout to know if it is existed or not. </p>
  
  <p>Here is code in functions.php</p>
  
  <pre><code>add_action('wp_enqueue_scripts', 'live_validation' );
  add_action('wp_ajax_validate_email', 'validate_email_input');
  add_action('wp_ajax_nopriv_validate_email', 'validate_email_input');
  
  function live_validation() {
  wp_enqueue_script( "validate_email", get_stylesheet_directory_uri() . '/check-email.js', array( 'jquery' ) );
  wp_localize_script( "validate_email", "validateEmail", array( 'ajaxurl' =&gt; admin_url( 'admin-ajax.php' ) ) );
  }
  
  function validate_email_input() {
  global $wpdb;
  $email = $_POST['billing_email'];
  if ( email_exists($email) ) {
      echo 'existed'; 
  } else {
      echo 'not exist';
  }
  exit;
  }
  </code></pre>
  
  <p>And this is js file</p>
  
  <pre><code>jQuery(document).ready(function($) {
  $('input[name=billing_email]').change(function() {
  
      var input_value = $(this).val();
  
      $.post( validateEmail.ajaxurl, { action:'validate_email', billing_email:input_value }, function(data) {
          $('.message').html(data);
      });
  });
  });
  </code></pre>
  
  <p>HTML form</p>
  
  <pre><code>&lt;p class="form-row form-row form-row form-row-first validate-required woocommerce-validated" id="billing_email_field"&gt;
  &lt;label for="billing_email" class=""&gt;Email &lt;abbr class="required" title="required"&gt;*&lt;/abbr&gt;&lt;/label&gt;
  &lt;input type="text" class="input-text " name="billing_email" id="billing_email" placeholder="Email" value="abc@gmail.com"&gt;&lt;/p&gt;
  &lt;span class="message"&gt;&lt;/span&gt;
  </code></pre>
  
  <p>I can see admin-ajax file fired when input value of billing_email changed, but the notification didn't show. </p>
  
  <p>Please help. Thanks.</p>