I have a text box, that you input a date into (eg: 1/2/2003), and then the user will hit a submit button. If the date is in the future, the page will post a message saying you cannot enter data for a future date.
Here is the code I'm using: The name of the text box is Activity_Date
--------------------
Today = date()
Today = trim(Today)
If Activity_Date > Today then
'redirect the user to the page, with message, saying they need to enter a date that is not in the future.
end if
--------------------
Everything appears to be in line, at least in my head, anyway, but when I run the code, no matter what date I select, past or present, it says that I cannot enter data for a future date. I have run the page in debug, and for both the Activity_Date and Today, the date is in "", so it shouldn't be a formatting problem. I am going to try to mess with JavaScript, and see what that does, but I want to find out what I'm doing wrong with the code above. I"m sure it's something simple. Thanks for any help.
Here is the code I'm using: The name of the text box is Activity_Date
--------------------
Today = date()
Today = trim(Today)
If Activity_Date > Today then
'redirect the user to the page, with message, saying they need to enter a date that is not in the future.
end if
--------------------
Everything appears to be in line, at least in my head, anyway, but when I run the code, no matter what date I select, past or present, it says that I cannot enter data for a future date. I have run the page in debug, and for both the Activity_Date and Today, the date is in "", so it shouldn't be a formatting problem. I am going to try to mess with JavaScript, and see what that does, but I want to find out what I'm doing wrong with the code above. I"m sure it's something simple. Thanks for any help.