I am trying to write a `Less than` validator for jQuery.
I want to compare one text box against another, so if I have:
```html
```
I want my `validator` to look like
```javascript
$('#myForm').validate({rules: { value1: { lessThan: "#value2" } } });
```
I have tried this but I can't get it to work:
```javascript
$.validator.addMethod('lessThan', function(value, element, param) {
var i = parseInt(value);
var j = parseInt($(param).val());
return i >= j;
}, "Less Than");
```
Another question is where should I put that code? In `$(document).ready` or just in a `