Question

reg difference between fields

Hi Team

I attempted to perform validation by comparing two fields

for example, I kept a validation on Minimum CTC and maximum CTC(i.e minimum ctc should be greater than maximum CTC) I succeded to perform this operation.

 

But when I changed the minimum CTC again the validation was not working as expected.

please check my code once

        methods: {

    setValidationConfig: function() {

                // Calls the initialization of validators for the parent view model.

                    this.callParent(arguments);

                // The phoneValidator() validate method is added to the [Phone] column.



                     this.addColumnValidator("UsrMinimumCTC", this.ctcValidation);

                    this.addColumnValidator("UsrMaximumCTC", this.ctcValidation);

                   

                },

                ctcValidation: function() {

                // Variable for storing a validation error message.

                var invalidMessage = "";

                var minimumage = this.get("UsrMinimumCTC");

                var maximumage = this.get("UsrMaximumCTC");

                if (maximumage <= minimumage) {

                    invalidMessage = this.get("Resources.Strings.Agevalidator");

                }

                return {

                // Validation error message.

                    invalidMessage: invalidMessage

                    };

                }

},

 

Hoping for positive Reply.

Regards

manikanta.

 

 

 

 

 

 

 

 

 

 

 

Like 0

Like

0 comments
Show all comments