This topic is locked

Date Validation

3/16/2013 12:33:54 AM
PHPRunner General questions
T
Tornado973 author

I am trying to add Date Validation for End Date being > my start date. I am trying to add this is the Before add events for the page. Can someone confirm this is correct.
if Datetime(values("Start")) > Datetime(values("End")) then
message = "Start date can not be later than End date."
BeforeAdd = False
else
BeforeAdd = True
end if
if Datetime(values("Start")) < Datetime(values("End")) then
message = "End date can not be earlier than Start date."
BeforeAdd = False
else
BeforeAdd = True
end if

J
jdu001 3/16/2013



I am trying to add Date Validation for End Date being > my start date. I am trying to add this is the Before add events for the page. Can someone confirm this is correct.
if Datetime(values("Start")) > Datetime(values("End")) then
message = "Start date can not be later than End date."
BeforeAdd = False
else
BeforeAdd = True
end if
if Datetime(values("Start")) < Datetime(values("End")) then
BeforeAdd = True
else
message = "End date can not be earlier than Start date."
BeforeAdd = False



end if


The second condition said: If startdate less than enddate give message "End date is before start date".

T
Tornado973 author 3/16/2013



The second condition said: If startdate less than enddate give message "End date is before start date".


Iam getting errors

T
Tornado973 author 3/19/2013

Can anyone help with this.



Iam getting errors

Sergey Kornilov admin 3/19/2013

A first word of advice - do not paste ASP code to PHPRunner. Find a respective piece of code from PHPRunner manual and use it.
It would also help if you post exact error messages here.