New Response

« Return to the main article

You are replying to:

  1. I am using the validator (love it!) but having a problem validating that an End date is greater than a Start date when the Start date is in 2007 and the End date is in 2008.

    I have entered the Dateformat of 'mm/dd/yyyy' in validation.js and this is the format on my server.

    Here is an example of my custom validation: {name: "endDate", type: "custom", expression: "startEndFunction(this.form.endDate.value, this.form.startDate.value)", message: "The End Date must be greater than the Start Date"},

    Here is my function: // If a date is entered in the End Date field, it must be greater than the entry in the Start Date field. function startEndFunction(entered, start){ if (entered != "") { return entered > start } return true }

    Any suggestions would be much appreciated.


Your Comments