PC Review


Reply
Thread Tools Rate Thread

ASP date matching

 
 
Metta
Guest
Posts: n/a
 
      13th Apr 2007
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


 
Reply With Quote
 
 
 
 
Jon Spivey
Guest
Posts: n/a
 
      13th Apr 2007
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

"Metta" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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
>



 
Reply With Quote
 
Metta
Guest
Posts: n/a
 
      13th Apr 2007
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





"Jon Spivey" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
> "Metta" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>>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
>>

>
>




 
Reply With Quote
 
David Berry
Guest
Posts: n/a
 
      13th Apr 2007
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.

--
David Berry
Microsoft MVP - FrontPage
FrontPage Support: http://www.frontpagemvps.com/
-----------------------------------
To assist you in getting the best answers for FrontPage support see:
http://www.frontpagemvps.com/FrontPa...3/Default.aspx
-----------------------------------


"Metta" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>
>
>
>
> "Jon Spivey" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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
>>
>> "Metta" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>>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
>>>

>>
>>

>
>
>



 
Reply With Quote
 
Jon Spivey
Guest
Posts: n/a
 
      13th Apr 2007
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

"Metta" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>
>
>
>
> "Jon Spivey" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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
>>
>> "Metta" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>>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
>>>

>>
>>

>
>
>



 
Reply With Quote
 
Metta
Guest
Posts: n/a
 
      13th Apr 2007
Thanks Jon

M


"Jon Spivey" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
> "Metta" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> 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
>>
>>
>>
>>
>>
>> "Jon Spivey" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>>> 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
>>>
>>> "Metta" <(E-Mail Removed)> wrote in message
>>> news:(E-Mail Removed)...
>>>>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
>>>>
>>>
>>>

>>
>>
>>

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Matching a date or value Eric Microsoft Excel Programming 2 18th Feb 2008 02:44 PM
Help me to first row matching First date and last row matching lastrow HammerJoe@gmail.com Microsoft Excel Programming 3 21st Jan 2008 04:32 PM
Sum Rows with a matching date teeb Microsoft Excel Misc 4 18th Apr 2006 12:49 PM
Matching Date From Two Groups =?Utf-8?B?d3N0ZWVs?= Microsoft Excel Worksheet Functions 3 25th Jun 2005 02:58 AM
Windows Explorer - Date Created and Date Modified Matching iltf124 no spam @hotmail.com Windows XP Help 0 4th Feb 2004 04:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:17 AM.