2
I have Contacts field on the page where the user must fill, for example, the name, it should only type letters, in the phone field, only numbers and email required the use of "@". The idea is to display a message to the user when they enter number in the "name" field and so on.
I was able to capture user input, but regular expression does not work.
This is my code:
var validaNome = $("#input-nome");
validaNome.on("input", function(){
var digitado = validaNome.val();
var comparavel = new RegExp("ab+c");
if(digitado <= comparavel){
$(".digite-nome").css("display", "none");
}else {
$(".digite-nome").css("display", "block");
};
});
The comparable variable receives regular expression and then uses it in validation.
Could someone help me? Or is there another way to validate this?
AMAZING! AMAZING! Thank you so much
– Guilherme Macedo