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)

Decimal Numbers or Floats

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

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>

Float Numbers

Positive Float Numbers

Negative Float Numbers