Marnen is correct here and it is actually the easiest way of doing things. Let's say you have someone that placed anything in the field like so:
my number is (492)-4321234 my number is [492]-432-1234 my number is (4924321234) What is your application is used by other people worldwide? In this case the country has a country code, a local number, and an international format: China Country code 86 China Local (10) 69445464 China International 861069445464 France Country code 33 France Local 06 87 71 23 45 France International 33687712345 etc. etc. As you can see by this example, now you are dealing with formatting of numbers that could have 2 or 3 extra digits. This is exactly why validation fails in some cases because some of the cases are unique enough that it would take a complicated effort to product a simple one. In this case above you can use regexp to remove all non-digit formats and you could even take it a step farther if you wanted to by reading non-us numbers in their international format based upon their country code. It's up to you. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

