Last active
March 14, 2019 14:09
-
-
Save propertyhive/c341b812406634bbc2a0a75b59795d72 to your computer and use it in GitHub Desktop.
Add custom validation to property
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'propertyhive_property_address_fields', 'add_property_address_validation' ); | |
function add_property_address_validation() | |
{ | |
?> | |
<script> | |
jQuery('.wrap form').submit(function() | |
{ | |
if (jQuery(this).find('input[name=\'_address_three\']').val() == '') | |
{ | |
alert('Please enter the property town/city'); | |
return false; | |
} | |
return true; // passed validation | |
}); | |
</script> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment