This topic is locked
[SOLVED]

 Date Validation

9/16/2013 2:21:40 PM
PHPRunner General questions
D
dustinforehand author

I am very new to php/mysql - and trying to learn through this forum.

I have a simple table that has the following fields(ID, Case, Schedule Date)

I am trying to validate the schedule date field that it has to be 5 days after the current date.

I do not want the record to be added unless the scheduledate field is 5 days after the current date.

I hope I explained this well enough

C
cgphp 9/16/2013

In the "Before record added" event, add the following code:

if(strtotime($values['Schedule_Date']) < strtotime("+5 days"))

{

$message = "The schedule date must be 5 days after the current date";

return false;

}


I'm assuming the schedule date field is Schedule_Date

D
dustinforehand author 9/16/2013

Christain Gile --- THANK YOU SO MUCH!!! I really appreciate it.



In the "Before record added" event, add the following code:

if(strtotime($values['Schedule_Date']) < strtotime("+5 days"))

{

$message = "The schedule date must be 5 days after the current date";

return false;

}


I'm assuming the schedule date field is Schedule_Date