ASP date matching

  • Thread starter Thread starter Metta
  • Start date Start date
M

Metta

I am trying to check today's date against a form entry, something like

<%If request ("dcheck")<>Date() Then%>
ERROR
<%Else%>

Where "dcheck" will be within hidden form field as <%=Date()%>

Thanks

M
 
if you're populating a hidden field with <%=Date()%> when the forms
submitted surely there's no way it could not be equal to date()? Unless
maybe somebody viewed the form at 11:59 and submitted it a minute later.
Maybe I don't understand the question :-)

Cheers,
Jon
 
Maybe i'm not being very clear.

I am having problems where cached forms are being used and am trying to
prevent out of date form data being submitted to a db so thought I could use
the date (and/or time) as a simple lock or include time with some sort of
"If form time < (now + say 15 mins) then ERROR

Any help with this appreciated.

Thanks
M
 
I guess I'm missing the question as well. How are the forms being cached?
Once a form is submitted the user should be presented with a new blank form
the next time they go to it.
 
Ok, I see now. You could do something like this
<%
if datediff("n", request("datefield"), now()) > 15 then
' error
end if
%>

This will throw the error if the difference is > 15 minutes

Cheers,
Jon
 
Thanks Jon

M


Jon Spivey said:
Ok, I see now. You could do something like this
<%
if datediff("n", request("datefield"), now()) > 15 then
' error
end if
%>

This will throw the error if the difference is > 15 minutes

Cheers,
Jon
 
Back
Top