jQWidgets Forums

This topic contains 1 reply, has 2 voices, and was last updated by  Peter Stoev 11 years, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • Validator On/Off #26884

    simcon94
    Participant

    Hi,
    i have a problem.
    I have one form on a popup Window. This form you can activate or not with an Checkbox.
    Is the Form activated, so the form must have an validator. Isn’t the form activated, so the validator have to go “off”.

    How can i hanlde it?

    Validator On/Off #26898

    Peter Stoev
    Keymaster

    Hi simcon94,

    I would suggest you as a solution to add custom validation rules defined in that way:

              { input: '#birthInput', message: 'Your birth date must be between 1/1/1900 and 1/1/2012.', action: 'valuechanged', rule: function (input, commit) {
    var date = $('#birthInput').jqxDateTimeInput('value');
    var result = date.getFullYear() >= 1900 && date.getFullYear() <= 2012;
    // call commit with false, when you are doing server validation and you want to display a validation error on this field.
    return result;
    }

    Then depending on some custom boolean flag which determines whether you should validate or not at all, you will return true in the custom validation functions when you do not have to validate and you will return true or false when you need to validate your inputs and the validation condition passes or fails.

    Best Regards,
    Peter Stoev

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

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

You must be logged in to reply to this topic.