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)

Whole Numbers (Integers)

These are examples for whole numbers only.
data-val-checkType="number" can be specified as an attribute to check for a valid number and then format options for whole numbers. Data formats are available for this type by supplying data-val-checkFormat="" options for integers.

Example: (positive numbers)
<input type="text" data-val-error-text="Please supply a valid number." data-val-error-title="Number" data-val-required="1"  
	id="int" name="int" data-val-checkType="number"  data-val-checkFormat="int"  />

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

Integer Numbers

Positive Integer Numbers

Negative Integer Numbers