Field jQuery mask for mobile/landline phone with ninth digit

Asked

Viewed 65 times

1

I got the following jQuery

jQuery(function($){
   $("#telefone").mask("(99) 9 9999-9999");
   $("#celular").mask("(99) 9 9999-9999");
});

However, when typing the number in the field, if it is a landline for example, it Zera the field, because the landline does not have the ninth digit. How can I adjust that question?

  • There is already an answer here: http://answall.com/a/42242/46523

  • 2

    Great, thank you so much! :)

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.