This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes JavaScript mask for Brasil phone number Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "JavaScript mask for Brasil phone number" Watch "JavaScript mask for Brasil phone number" New topic
Author

JavaScript mask for Brasil phone number

Hikari Shidou
Ranch Hand

Joined: Jan 22, 2013
Posts: 88
Heelo guys!

Currently I'm using jquery.maskedinput for various mask formats, but it's not working for phone numbers.

In Brasil we used to have all numbers in the format (99)9999-9999. But lately, in a few cities, cell phones are using (99)99999-9999, while normal phones and the rest of the country remain (99)9999-9999.

jquery.maskedinput seems to not support 2 formats on the same input where a character in the middle of the string may or may not be present. As I can see in its documentation, I could have (99)9999-9999 and (99)9999-99999, but that would confuse users.

Is there any other mask plugin/framework that allows me to validate both (99)9999-9999 and (99)99999-9999?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JavaScript mask for Brasil phone number
 
Similar Threads
Updating a form in primefaces when a selection is made in the datatable
using SMS to send jar/jad OTA
Validation FrameWork Question
Matches I love to see
How to represent int 1 as 0001?