Hi,
created a field in a form requestdate which is a date field. Now i want to prevent that people select a day in the past and thus generate a message telling the user: You cannot select a date in the past, please select a proper date.
I think i need to do that using a validator, but i am not sure whether there is something like “current_date” or “today” to indicate that requesteddate<current_date (or today)…
Any ideas?
thnx
emveha
Hi,
You can use this code :
Date today = new Date(); //It is automatically set to the current date
return !(requestedDate.getTime() < today.getTime());
Hi Yannick,
while trying your suggested solution, the system is telling me that there is an issue: “today cannot be resolved. It may lead to runtime error”. Any idea what is going wrong??
thnx
if i use this script the system tells me: Today cannot be resolved. It may lead to runtime errors.
Any ideas how to solve this
thnx