Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $('#frm_user_details').formValidation('validate');
- $('#frm_user_details').formValidation({
- framework: 'bootstrap',
- fields: {
- register_first_name: {
- validators: {
- notEmpty: {
- message: 'Please enter your first name'
- }
- }
- },
- register_last_name: {
- validators: {
- notEmpty: {
- message: 'Please enter your last name'
- }
- }
- },
- username: {
- validators: {
- notEmpty: {
- message: 'Please enter a username.'
- },
- remote: {
- type: 'POST',
- url: '/core/services/validator.php',
- message: 'That username is already taken.',
- delay: 500
- }
- }
- },
- register_password: {
- validators: {
- notEmpty: {
- message: 'The password is required and cannot be empty'
- },
- identical: {
- field: 'register_password_retyped',
- message: 'The password and its confirm must be the same'
- }
- }
- },
- register_password_retyped: {
- validators: {
- notEmpty: {
- message: 'The confirm password is required and cannot be empty'
- },
- identical: {
- field: 'register_password',
- message: 'The password and its confirm must be the same'
- }
- }
- },
- },
- onError: function(e) {
- e.preventDefault();
- $('#create_account').removeClass('button-disabled');
- },
- onSuccess: function(e) {
- e.preventDefault();
- $('#create_account').addClass('button-disabled');
- THIS.services.submitHandler();
- }
- }
- });
- $(formSelector).formValidation({
- live : disabled,
- //other properties
- $(document).ready(function() {
- $('<your_selector>').formValidation({
- live : 'disabled'
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement