I want to make a custom validation for an phone number input.
var telVal = $("#telefon").val();
if(telVal == '') {
$("#telefon").addClass('eroare png');
hasError = true;
}
This gives me an error if user does not type anything in this input, but I want to check if user types 10 characters. So, the script must be like
if(telVal has 9 characters or more
than 10) { do this }
Thank you!
So basically, if it’s not 10?