The compareToValidator is only useful for handling the comparison
between two valid fields.

So if one of the fields is null, then there's no point in running this
validation (and it won't run).  Also, if you have date format input
errors, this would need to be handled by a different converter.

In summary, you need to handle the cases where one (or both) of the
inputs are optional externally to the compareTo validator.   You need
to handle the case where an input is invalid separately (probably with
a date validator).

You can add as many validators as you like to an input, so extending
the compareTo validator isn't the best choice when you can simply add
a date-specific validator.

On 1/11/07, Michael Heinen <[EMAIL PROTECTED]> wrote:




I have two date fields: dateStart and dateEnd.

Both are optional. It is valid to enter just one of them.

If both are entered than dateEnd must be of course after dateStart.

I tried s:validateCompareTo therefore.

Unfortunately this does not work if dateStart is empty.

Any suggestions how to compare them in this case?

Is it possible with this tag or do I have to extend the validator ?



BTW it does not work as I expected if one of the dates is not entered
correctly, e.g. wrong format or just a string.

In this case I got the conversion error message and the validation error
message.

I think this is just confusing the user.



Cheers,

Michael


Reply via email to