I have 1 textbox and 1 button (as check). I wanted to validate whether the adhaar number is valid or not using verhoeff algorithm using javascript -
var d = [ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], [1, 2, 3, 4, 0, 6, 7, 8, 9, 5], [2, 3, 4, 0, 1, 7, 8, 9, 5, 6], [3, 4, 0, 1, 2, 8, 9, 5, 6, 7], [4, 0, 1, 2, 3, 9, 5, 6, 7, 8], [5, 9, 8, 7, 6, 0, 4, 3, 2, 1], [6, 5, 9, 8, 7, 1, 0, 4, 3, 2], [7, 6, 5, 9, 8, 2, 1, 0, 4, 3], [8, 7, 6, 5, 9, 3, 2, 1, 0, 4], [9, 8, 7, 6, 5, 4, 3, 2, 1, 0] ]; $('#userform').formvalidation({ message: 'this value not valid', feedbackicons: { valid: 'glyphicon glyphicon-ok', invalid: 'glyphicon glyphicon-remove', validating: 'glyphicon glyphicon-refresh' }, fields: {aadhaar_no: { validators: { digits: { message: 'please use numeric characters only.' }, stringlength: { min: 12, max: 12, message: 'the aadhaar number must 12 characters long' }, identical: { field: 'c_aadhaar_number', message: 'the aadhaar number , confirm field not same' }, callback: { message: 'the input string not valid aadhaar number.', callback: function (value, validator, $field) { return validate(value); }
Comments
Post a Comment