1
I’m using this code to block the special characters, but this blocking also in the email field. how do I resolve? or how do I allow @ and _
$(function(){
var regex = new RegExp('[^ 0-9a-zA-Zàèìòùáéíóúâêîôûãõ\b-]', 'g');
// repare a flag "g" de global, para substituir todas as ocorrências
$('input').bind('input', function(){
$(this).val($(this).val().replace(regex, ''));
});
})
You just need to add inside the brackets:
– Sorack