Hi Alberto, I see! After some googling I found that the problem here is that the Date function you use in the min/max attribute isn't your default javascript/java Date class, but some helper function in the org.outerj.expression package.
This function has only one signature (as stated in the first error message) which is: new Date(Year,Month, Day) For convenience they also provided a helper functions for returning the current date which is: Now() so, your code should be: <fd:range min="Now()" max="Date(2021,12,31)" /> regards, Arthur Bogaart > > Arthur Bogaart wrote: > > Hi Alberto, > > > > In order to call the constructor of the Date class you'll > have to prepend the attribute statements with the "new" keyword. > > > > <fd:range min="new Date()" max="new Date(2021,12,31)" /> > > > > Doing this validation of the form return the following > message any date > I set: > > - Error evaluating "min" expression on "range" validation rule > > Thanks > > Alberto > > regards, > > > > Arthur Bogaart > > > > > > > >> I have a date field that must not contain a value lower than the > >> current date. > >> I tried the following validation: > >> > >> <fd:range min="Date()" max="Date(2021,12,31)" /> > >> > >> but cocoon responds: > >> > >> org.outerj.expression.ExpressionException: Date function > requires 3 > >> argument(s) at line 0, column 0 > >> > >> > >> What's wrong? Both Javascript and Java Date class have Date() > >> constructor (without parameters). So, isn't javascript code > >> that I put > >> in min or max attributes? > >> > >> Thanks in advance > >> > >> Alberto Brosich > >> > >> > --------------------------------------------------------------------- > >> To unsubscribe, e-mail: [EMAIL PROTECTED] > >> For additional commands, e-mail: [EMAIL PROTECTED] > >> > >> > >> > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
