formValidation.js 1.15 KB
$(document).ready(function() {
$('#registerFormTag').formValidation({
        framework: 'bootstrap',
        err: {
            container: '#messages'
        },
        icon: {
            valid: 'glyphicon glyphicon-ok',
            invalid: 'glyphicon glyphicon-remove',
            validating: 'glyphicon glyphicon-refresh'
        },
        fields: {
            vatsimID: {
                validators: {
                    notEmpty: {
                        message: 'The VATSIM ID is required'
                    },
                    stringLength: {
                        min: 6,
                        max: 7,
                        message: 'The VATSIM ID must be more than 6 and less than 7 characters long'
                    },
                    regexp: {
                        regexp: /^[0-9]*$/,
                        message: 'The VATSIM ID can only consist of numbers'
                    }
                }
            },
            email: {
                validators: {
                    notEmpty: {
                        message: 'The password is required'
                    }
                }
            }
        }
    });
});