Email validation for fields with labels in another language.
<script>
//Easier method that uses our default email validation func
jQuery(document).ready(function() {
ijQuery("input[name='" + base64_encode("Field name") + "']").attr( 'type','email' );
});
</script>
<script>
ijQuery(document).ready(function(){
ijQuery.validator.addMethod( 'example', function( value, element )
{
var email = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
if( value.match(email))
{
return true;
}
else
{
return false;
}
} );
var name = 'Mobile Phone';
ijQuery( 'form [name="' + base64_encode( "Courriel *" ) + '"]' ).addClass( 'example' );
ijQuery.extend( ijQuery.validator.messages,{ example: 'Veuillez saisir une adresse électronique valide.'} );
});
</script>