Comparing two field value in a autoform with schema validation


#1

hi , i don’t know how to comparing two field value in a autoform with schema validation .

example: i have schema like below i want to validated paidAmount can’t bigger than dueAmount . thank for advance !

Dental.Schema.Payment = new SimpleSchema({

dueAmount: {

    type: Number,

    decimal: true,

    label: 'Due Amount'

},

paidAmount: {

    type: Number,

    decimal: true,

    min: 1,

    label: 'Paid Amount'

}

});