Title: Custom Validations
Last modified: January 12, 2021

---

# Custom Validations

 *  Resolved [isaiassilva1](https://wordpress.org/support/users/isaiassilva1/)
 * (@isaiassilva1)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/custom-validations/)
 * How to add custons validations
 * example: this email are exists
 * i’ve create a function check if email exists, but i need add custom validation“
   this email are exists”
 * check atual function
 * PHP
 *     ```
       // Query
       $sql = "SELECT FIELDS,STATUS FROM wp_evf_entries WHERE STATUS = 'publish' ";
       $result = $conn->query($sql);
   
       // request _POST
       $email = '';
       $email = $_POST['email'];
   
       if ($result->num_rows > 0) {
       	// output data of each row
       	while ($row = $result->fetch_assoc()) {
   
       		// create array only email field
       		$varAux = explode(',', $row['FIELDS'], -1);
       		$varAux2 = explode('"', $varAux[6], -1);
   
       		// verify exist email
       		if($email == $varAux2[3]){
       			echo true;
       			return false;
       		}else{
       			echo false;
       		}
       	}
       }
       ```
   
 * JQUERY
 *     ```
       <script>
       		jQuery(document).ready(function($) {
       			$("#evf-250-field_email").keyup(function() {
       				email = jQuery("#evf-250-field_email").val();
       				$.ajax({
       					type      : 'post', 
       					url       : 'validate_form.php', 
       					data      :  {email:email}, 
       					dataType  : 'html', 
       					success: function(result){
       						 if(result){
       							 jQuery("#evf-250-field_email").after("<label class='evf-error'>Este email já consta no banco de dados, verifique sua caixa de entrada e spam</label>");
                           jQuery(".evf-submit").prop('disabled', true);
       						 }
       						else{
       							jQuery("#evf-250-field_email").nextAll().remove();
                           jQuery(".evf-submit").prop("disabled", false);
       						}
       					}
   
       				}); 
       			});
       		});
       	</script>
       ```
   

Viewing 1 replies (of 1 total)

 *  [Saroj Shah](https://wordpress.org/support/users/wpeverestsupportrep/)
 * (@wpeverestsupportrep)
 * [5 years, 4 months ago](https://wordpress.org/support/topic/custom-validations/#post-13930811)
 * Hi there,
 * Sorry for the late response. This issue requires proper testing for which, I 
   request you to contact our developer team. You can contact them here: [https://wpeverest.com/contact/](https://wpeverest.com/contact/)
   so that they will try to replicate the issue on your site and provide you the
   fix ASAP.
 * Regards!

Viewing 1 replies (of 1 total)

The topic ‘Custom Validations’ is closed to new replies.

 * ![](https://ps.w.org/everest-forms/assets/icon.svg?rev=2778675)
 * [Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder](https://wordpress.org/plugins/everest-forms/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/everest-forms/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/everest-forms/)
 * [Active Topics](https://wordpress.org/support/plugin/everest-forms/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/everest-forms/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/everest-forms/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Saroj Shah](https://wordpress.org/support/users/wpeverestsupportrep/)
 * Last activity: [5 years, 4 months ago](https://wordpress.org/support/topic/custom-validations/#post-13930811)
 * Status: resolved