Subscribe now and get the first month free!

Implementing phone number validation

Implementing The Form Validator into a web form adds only one (1) line of html code.

The Form Validator has been installed into this form by adding the single html line colored in red. Please give special attention to adding the "onSubmit" method inside your form tag. The items in blue are parameters (instructions) passed to The Form Validator which indicate your registered domain name (r=) and the form element name that you're are using to capture the phone number (p=).

<script language="JavaScript"
src="https://ssl.4i4.net/validator/?r=yoursite.com&pc=your_phonenumber&speak=y">
</script>
<form name="form1" method="post" action=""
                        onSubmit="return validate(this)" >
<input name="your_phonenumber" type="text">
</form>

  phone number
 

For your convenience we provide this example html here in a pure text box.

The Form Validator is controlled by the url parameters passed to it on the <script> line.

  1. r= required and must be set to your registered domain name. In the example the registered domain name is "4i4.net" because the form is be served by this domain.
  2. p= identifies to The Form Validator the name of your phone number form field. In the example the form contains a data input field called "your_phonenumber" into which people will type their phone number. Setting "p=your_phonenumber" tells The Form Validator to use what ever is entered into that field as the phone number to check against its gigantic database. If you have more than one form element which needs phone number validation you can include them all in the "p=" parameter separated by a coma which might look like "p=home_phone,work_phone".
  3. pc= can be used in place of the p= parameter to cause an immediate phone call to be placed to the number entered into the form. This telephone call instructs the user to enter a pin code into their touch tone key pad. If the pin code is properly entered The Form Validator will be satisfied.
  4. bp=n,n,y this is an optional parameter indicating "blank phone" is yes, ok. Use this feature when you want to accept blank input. Use a comma seperated list aligned with your field names.
  5. Optionally you can append the speak=y to the url. This enable the synthetic voice responce.
  6. m=y signals The Form Validator to process multiple form field as opposed to validating the fields in the order that you request. All fields that you specify will be validated each time the form is submitted.

Note: The url for The Form Validator must start exactly like this: https://ssl.4i4.net/validator/?

Appended to the The Form Validator url you must provide your registered domain name that you submitted during your registration process in the form: r=your-domain.com url parameters are always separated by the & symbol. Following your register domain name parameter you append the p= parameter and the optional bp= parameter.

Phone number validation can be implemented together with all other validations The Form Validator offers.

Note: There are some limitations to validating phone numbers. For more details please review our limitations page viewable from the pull down menu.