I am looking for a way to easily implement an Integer field with webforms that can do mobile number validation (US numbers only). I am aware of http://drupal.org/project/webform_validation that can do numeric validation but looking for a more direct solution. If its a hook, that works as well.
Tell me more
×
Drupal Answers is a question and answer site for
Drupal developers and administrators. It's 100% free, no registration required.
|
You can do a hook_form_alter of your form, and add your own validation to it.
|
|||||||
|
|
Telephone numbers are not integers. For example they begin with a zero in Germany, which is meaningless for integers but significant when dialing. A string field would be more appropriate. You will also have to think about what quality of validation you need:
In all cases, the way to go is a validation function as per Danno's suggestion. For 2, you need information from the ITU and its members. For 3, sending an SMS with a validation code is probably the most effective way (although some landline phones can receive SMS). |
||||
|