validates_format_of :phone, :with => /\A\s*(?:(?:\+?(?:\d{1,3}(?:\s*|[\-.])))?\(?\d{3}[\-\/)]?\s*) (?:[2-9][0-9 \-.]{6,})\s*\z/,
i pit it on my reuriments but error whlie entering 666.111.9999 i want it should be ok any one help me please
validates_format_of :phone, :with => /\A\s*(?:(?:\+?(?:\d{1,3}(?:\s*|[\-.])))?\(?\d{3}[\-\/)]?\s*) (?:[2-9][0-9 \-.]{6,})\s*\z/,
i pit it on my reuriments but error whlie entering 666.111.9999 i want it should be ok any one help me please
ashu wrote:
validates_format_of :phone, :with => /\A\s*(?:(?:\+?(?:\d{1,3}(?:\s*|[\-.])))?\(?\d{3}[\-\/)]?\s*) (?:[2-9][0-9 \-.]{6,})\s*\z/,
i pit it on my reuriments but error whlie entering 666.111.9999 i want it should be ok any one help me please
Please post a set of valid and a set of invalid numbers.
T.
ashu wrote:
validates_format_of :phone, :with => /\A\s*(?:(?:\+?(?:\d{1,3}(?:\s*|[\-.])))?\(?\d{3}[\-\/)]?\s*) (?:[2-9][0-9 \-.]{6,})\s*\z/,
i pit it on my reuriments but error whlie entering 666.111.9999 i want it should be ok any one help me please
Don't do that. Your app should be smart enough not to care about the format of phone numbers.
Best,
i have done it myself in very well manner thanxxx