Last active
August 29, 2015 14:05
-
-
Save Uriel29/d968ed1f2f2134b9afac to your computer and use it in GitHub Desktop.
Script para validar E-mail no Seblod, baseado no script validar URL, mas foi modificado. (mainbody.php)
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
<?php echo $cck->renderField('email'); ?> //exemplo de campo para por o email | |
<?php echo $cck->renderField('enviar'); ?> | |
// obs o ID css de do campo email é #email | |
<script type="text/javascript"> | |
jQuery(function() { | |
jQuery('#email').blur (function() { | |
var txt =jQuery('#email').val(); | |
var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; | |
if (re.test(txt)) { | |
//alert('Valido') | |
} | |
else { | |
alert('Por favor, digite o email corretamente'); | |
return false; | |
} | |
}) | |
}) | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment