validation rule values and date

Hi
I've written an custom validator for checking a selecting a datepicker's date against a param date
I do not get any javascript error but no error is shown when i select the wrong date
I think the reason is how the Rule.Value is filled
How to fill Rule.Value with a date value?
Eric
I've written an custom validator for checking a selecting a datepicker's date against a param date
I do not get any javascript error but no error is shown when i select the wrong date
I think the reason is how the Rule.Value is filled
How to fill Rule.Value with a date value?
- Code: Select all
TestJS1 :=
' function(value, element, params) { ' +
' if (this.optional(element)) { ' +
' return true; ' +
' } ' +
' var thisDate = $(element).datepicker(''getDate''); ' +
' var thatDate = params[0]; ' +
' return (thisDate.getTime() < thatDate.getTime()); ' +
' } ';
IWCGJQDatePicker1.JQValidateOptions.AddMethod('dpCompareDateLess', TestJS1,'Minmax' );
IWCGJQDatePicker1.JQValidateOptions.Enable := True;
Rule1 := IWCGJQDatePicker1.JQValidateOptions.Rules.Add;
Rule1.CustomRule := 'dpCompareDateLess';
Rule1.Value := FormatDateTime(IWCGJQDatePicker1.JQDatePickerOptions.DateFormat,Date);
Eric