jQuery UI Widgets Forums Plugins Validator, Drag & Drop, Sortable Validator Message set on other Input

This topic contains 3 replies, has 2 voices, and was last updated by  alpesh 10 years, 4 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • Validator Message set on other Input #58208

    alpesh
    Participant

    Hello,

    We want to Validator Message set on other input field.

    
    { input: '#birthInput', message: 'Your birth date must be between 1/1/1990 and 1/1/2012.', action: 'valuechanged', rule: function (input, commit) {
                            var date = $('#birthInput').jqxDateTimeInput('value');
                            var result = date.getFullYear() < 1990;
                            if (result) {
                                $('#testForm').jqxValidator('rules')[2].message = "Date is below 1990";
                                return false;
                            }
                            return true;
                        }
                        },{ input: '#other_input', message: 'Your birth date must be between 1/1/1990 and 1/1/2012.', action: 'valuechanged', rule: function (input, commit) {
                            var validationString=serverAbsenceValidate();
                            if(validationString!=true){
                                $('#testForm').jqxValidator('rules')[2].message = validationString;
                                return false;
                            }else{
                                return true;  
                            } 
                        }
    

    We need on other_input value change to set validation on ‘#birthInput’ field.and We have try above like code.But It is not working.
    Could you please help us for ?

    Thanks
    Alpesh

    Validator Message set on other Input #58222

    alpesh
    Participant

    Hello,

    Any help will be greatly appreciated.

    Thanks

    Validator Message set on other Input #58223

    Dimitar
    Participant

    Hello alpesh,

    In the rule of other_input you can call:

    $('#testForm').jqxValidator('validateInput', '#birthInput');

    to validate the first input.

    Best Regards,
    Dimitar

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

    Validator Message set on other Input #58229

    alpesh
    Participant

    Thanks for reply,

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

You must be logged in to reply to this topic.