Download
User Rating: 0/5 ( 0 votes)
validater is a jquery plugin to help validating form elements, gathering form data and tiping.
Source: html5beta.com
1. INCLUDE JS FILES
<script src="jquery-1.11.1.min.js"></script>
<script src="validater.min.js"></script>
2. HTML
<input class="text-input" type="text" data-tip="only digital" data-reg="^[0-9]+$" name="digit" />
<input class="text-input" type="text" data-tip="only digital" data-reg="^[0-9]+$" name="name1" />
3. ATTRIBUTES
with * is required, other is just optional
-
name *: must be unique name
-
data-tip *: the tip shows when focus
-
data-ignore: if(true) when call $.validater.submit(), this input will be ignored
-
data-optional: if(true) when validating, it is treated as "optional"
-
data-reg: regular expression string, value will be validate with the regular expression new RegExp('regular expression string')
-
data-min-len: int(0~) min length validate
-
data-max-len: int(1~) max length validate
-
data-err-msg: the msg to show when error
-
data-reg-msg: the msg to show when regular expression validate return false
-
data-min-len-msg: the msg to show when min length validate return false
-
data-max-len-msg: the msg to show when max length validate return false
-
data-custom-msg: the msg to show when custom validate return false
-
data-no-tip: if(true) will not show any validate msg
-
data-no-ok-tip: if(true) will not show ok icon
-
data-events: the events trigger validation, eg: 'focus blur', default : 'keyup blur change'
-
data-err-wrap: the msg output positon(jquery selection string), eg: '#err-container'