Validation 2 fields

Validation 2 fields

mifosmifos Posts: 6Questions: 3Answers: 0

Hello , i want to ask how i can do that :

i have to fields with 2 date , "From Date" --- "To Date" , and i want to ask how i can set the validation which can do this :

Dates are
1) not Required ( Done )
2) can be empty ( Done )

BUT if "To Date" is not empty then "To Date" Must be Bigger then "From Date".

Answers

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin

    Is this with Editor? If so, you can apply multiple validation methods to a single field (Manual). Simply call the validator() method multiple times.

    Allan

  • mifosmifos Posts: 6Questions: 3Answers: 0

    yes is with editor.i check that link but the problem is that how can i compare the value of the "From Date" if not empty to "To Date" if not empty and recheck it if is bigger then "From Date" .

  • allanallan Posts: 63,687Questions: 1Answers: 10,500 Site admin

    You would need to provide a custom validation method (details on how to do that are included in the documentation page above) that would perform the less than validation. You could then use a different validator to perform the greater than validation, or the two could be bundled together into a single custom function.

    Allan

This discussion has been closed.