Skip to main content
Topic: ValidationType ---> Phone Number? (Read 3281 times) previous topic - next topic

ValidationType ---> Phone Number?

Hello,

This was asked before in the /support/ area, and didn't get an answer.  I'm posting here again.

I am having trouble with field Validation/formatting on an "Add" Page, and would like to validate a textbox to ensure that the users entry meets common 'phone number' format before it gets added to the database. (Ensure format like ###-###-####, or (###)###-####, etc)

I have the textbox set to Type = "Tel", Validation set to "True", yet the only validation types that appear in the list are "alpha", "alpha_num", "alpha_dash", "alpha_spaces" & "credit card".

Shouldn't "phone_number" be listed? How can I implement it? (I've searched through the includes, and I see in the GUMP Library there is "validate_phone_number", yet including ('validate_phone_number', 'phone_number', or 'phone') doesn't seem to work.

The code in GUMP looks exactly like what I'd like to use... How do I expose it???

Also, I've tried using RegExp (^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$), but that doesn't even seem to get added to the output code (also logged as separate support issue).

Am I missing something, or does validation even work? Please help! Thank you!

Re: ValidationType ---> Phone Number?

Reply #1
My Regexp ^[0-9]{1,2}[:.,-]?$ to limit to 2 digits had no effect either.

Re: ValidationType ---> Phone Number?

Reply #2
hello did you solve the problem?

Iknow it was a long time ago but i have the same problem. Can you help me if you solve the issue ?