Login

Tag "area-code"

Snippet List

UKPhoneNumberField GB v3 (improved)

Validates and cleans UK telephone numbers. Number length is checked, and numbers are cleaned into a common format. For example, "+44 (0)1234 567890" will be stored as "01234 567890". Can reject premium numbers (0912 312 3123) or service numbers (1471, 118 118) with UKPhoneNumberField(reject=('premium', 'service')) Can reject multiple number types so you can tune the form input to accept only landline or only mobile, or whatever combination you want. Corrects the errors found in http://djangosnippets.org/snippets/1207/ and adds extra functionality and detail to the code found at http://djangosnippets.org/snippets/2809/ In particular, this version rejects individual invalid area codes and caters for area codes with mixed-length numbering in fine-grained detail. **Uses info from:** [here](http://www.aa-asterisk.org.uk/index.php/Regular_Expressions_for_Validating_and_Formatting_UK_Telephone_Numbers)

  • form
  • field
  • uk
  • localflavor
  • form_field
  • model_field
  • telephone
  • gb
  • area-code
Read More

UKPhoneNumberField GB v2

Validates and cleans UK telephone numbers. Number length is checked, and numbers are cleaned into a common format. For example, "+44 (0)1234 567890" will be stored as "01234 567890" Can reject premium numbers (0912 312 3123) or service numbers (1471, 118 118) with UKPhoneNumberField(reject=('premium', 'service')) Corrects the errors found in http://djangosnippets.org/snippets/1207/

  • form
  • field
  • uk
  • localflavor
  • form_field
  • model_field
  • telephone
  • gb
  • area-code
Read More

3 snippets posted so far.