I am new to KnockoutJS and I am having some trouble with validation. I have two textboxes and I am trying to validate to ensure that textbox1 input value is greater than textbox2 input value.
<input type="number" id="tbLow" name="tbLow" data-bind="value: model.tbLow"/>
<input type="number" id="tbHigh" name="tbHigh" data-bind="value: model.tbHigh"/>
this isthe validation for tbLow:
self.model.tbLow.extend({
min: 1,
max: 999999,
maxLength: 6,
validation: { validator: greaterThan,
message: 'tbHigh must be larger than Car tbLow.',
params: tbHigh }
});
here is the validation function:
var greaterThan = function (tbLow, tbHigh ) {
return CarNumberHigh > CarNumberLow;
}
I am not able to get the value for tbHigh
...
Any ideas??