Question

Ello, I'm using jQuery-Validation-Engine and i don't know if this is currently possible but, Is there a way for you to possibly use the funcCall in a senario such as this.

I have to check a date range using 2 textboxes. I want to bind funcCall[dateRangeCheck] in such a way that I can get access to 2 fields as opposed to just the one. The end result would would something like this.


dateRangeCheck = function (fields, rules, i, options) {
    if (isDate(fields[0]) && isDate(fields[1])) {
        if (!dateCompare(fields[0], fields[1])) {
         return "* Invalid Date Range";
        }
    }
 };

Or possibly all the fields that a utilizing this particular funcCall like this


dateRangeCheck = function (fields, rules, i, options) {
    for (var i=0;i<fields.length;i++)
       if(!isDate(fields[i]){
          return "* Invalid Date Range";
       }
    }
 };

Is there some way to accomplish this?

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top