A quick question regarding phone validation

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
rjfg's picture

Hi all.

A quick question regarding webform phone validation that is hopefully very straight foward if anyone had the same issue.

I am using the phone module:
https://www.drupal.org/project/phone

which doesn't include validation for Ireland.

Does anybody know the best way to add Ireland to the list?

I am currently using the "international phone validation per E. 123" as a plan-b and it doesn't seem to work, it gives a "is not a valid Italian phone number" error.

Many thanks in advance.

Comments

Don't

stella's picture

My advance would be to don't do it.

It's a PITA. You've got to deal with and without the +353 bit, then you'll have people entering +353 (0)1 12345678 and others entering +353112345678. You'll have people who use spaces, people who use hypens, people who use brackets. And then you'll have people who want to say, e.g. "ext 5489".

On top of that you've got different length area codes - e.g. 01 vs 052 vs 0404, as well as different length phone numbers themselves, so my sister's phone only has 5 digits after the area code, whereas in Dublin we have 7.

Oh and then there's 1890 numbers etc.

So yeah, I wouldn't go there if I were you.

I won't

rjfg's picture

Ok, I won't validate then. Will use a normal textfield and problem solved.

Thanks, great advice.