Skip to content

Instantly share code, notes, and snippets.

@Uriel29
Last active August 29, 2015 14:05
Show Gist options
  • Save Uriel29/d968ed1f2f2134b9afac to your computer and use it in GitHub Desktop.
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)
<?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