Form Validation Toolkit

Data Type Tests



Minimum Steps to Validation:

1. Set the validation attributes of the input field
2. Attach (Initiate) the JavaScript validation process to the form (or the fields)

Phone

These are examples for phone number entries.
data-val-checkType="phone" can be specified as an attribute to check for approximate valid phone numbers (not a strict rule). Ddata formats are available for this type by supplying data-val-checkFormat="" to check for US vs. international formats.

Example: (positive numbers)
<input type="text" name="phone" data-val-required="1" data-val-checkType="phone" data-val-checkFormat="us" />
<input type="text" name="phone" data-val-required="1" data-val-checkType="phone" data-val-checkFormat="international"  />

<script>
	$('#data-type-test-form').initValidation();
</script>

Phone (US)

Any Phone