Here's an attempt to provide validation and formatting for Israeli phone numbers. I used a copy of the US formatter as a starting point.

I've never been to Israel nor dialed an Israeli phone number in my life, but here's what I know from talking to some colleagues and reading this wikipedia page: http://en.wikipedia.org/wiki/Telephone_numbers_in_Israel. Israeli area codes start with a zero locally, otherwise they are just a one-or-two digit number. I tried to validate for the area codes described in the wiki article (only codes starting with 5 or 7 have two digits, no codes that start with 5 have a 1 as the second digit, those that start with 7 don't have 1, 5, 8, or 9, and there are no codes that start with 6), but it probably needs more detailed error messages for those cases. I wasn't sure if the sanitize hook is necessary since the leading 0 won't pass validation is appended automatically when formatting as a local number, but it also may be counter to common sense to forbid it if people are used to starting their numbers with a 0.

This works for my purposes now, but it could use some feedback from someone who is familiar with both this module and Israeli phone numbers (are you out there?).

CommentFileSizeAuthor
cck_phone-israel_formatters.patch4.27 KBxaqrox
Support from Acquia helps fund testing for Drupal Acquia logo