jQWidgets Forums

jQuery UI Widgets Forums Plugins Validator, Drag & Drop, Sortable jqxValidator for jqxDateTimeInput is not working

This topic contains 2 replies, has 2 voices, and was last updated by  harunmahfud 10 years, 7 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author

  • harunmahfud
    Participant

    Why validator for datetime in this example is not working?

    $('#testForm').jqxValidator({
        rules: [
               { input: '#userInput', message: 'Username is required!', action: 'keyup, blur', rule: 'required' },
               { input: '#userInput', message: 'Your username must be between 3 and 12 characters!', action: 'keyup, blur', rule: 'length=3,12' },
               { input: '#realNameInput', message: 'Real Name is required!', action: 'keyup, blur', rule: 'required' },
               { input: '#realNameInput', message: 'Your real name must contain only letters!', action: 'keyup', rule: 'notNumber' },
               { input: '#realNameInput', message: 'Your real name must be between 3 and 12 characters!', action: 'keyup', rule: 'length=3,12' },
               {
                   input: '#birthInput', message: 'Your birth date must be between 1/1/1900 and 1/1/2014.', action: 'valuechanged', rule: function (input, commit) {
                       var date = $('#birthInput').jqxDateTimeInput('value');
                       var result = date.getFullYear() >= 1900 && date.getFullYear() <= 2014;
                       // call commit with false, when you are doing server validation and you want to display a validation error on this field. 
                       return result;
                   }
               },
               { input: '#passwordInput', message: 'Password is required!', action: 'keyup, blur', rule: 'required' },
               { input: '#passwordInput', message: 'Your password must be between 4 and 12 characters!', action: 'keyup, blur', rule: 'length=4,12' },
               { input: '#passwordConfirmInput', message: 'Password is required!', action: 'keyup, blur', rule: 'required' },
               {
                   input: '#passwordConfirmInput', message: 'Passwords doesn\'t match!', action: 'keyup, focus', rule: function (input, commit) {
                       // call commit with false, when you are doing server validation and you want to display a validation error on this field. 
                       if (input.val() === $('#passwordInput').val()) {
                           return true;
                       }
                       return false;
                   }
               },
               { input: '#emailInput', message: 'E-mail is required!', action: 'keyup, blur', rule: 'required' },
               { input: '#emailInput', message: 'Invalid e-mail!', action: 'keyup', rule: 'email' },
               { input: '#ssnInput', message: 'Invalid SSN!', action: 'valuechanged, blur', rule: 'ssn' },
               { input: '#phoneInput', message: 'Invalid phone number!', action: 'valuechanged, blur', rule: 'phone' },
               { input: '#zipInput', message: 'Invalid zip code!', action: 'valuechanged, blur', rule: 'zipCode' },
               { input: '#acceptInput', message: 'You have to accept the terms', action: 'change', rule: 'required', position: 'right:0,0' }]
    });

    Try to change birth year value to 2015 but still not showing warning.


    Nadezhda
    Participant

    Hello harunmahfud,

    jqxValidator does not work due to Breaking changes in jQWidgets v3.5.0. Please, rename the action “valuechanged” to “valueChanged”. For more information you can visit Release History page.

    Best Regards,
    Nadezhda

    jQWidgets team
    http://www.jqwidgets.com/


    harunmahfud
    Participant

    It works. Thanks. 😀

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.