This topic is locked

date insert control

8/9/2010 8:31:20 AM
PHPRunner General questions
S
sickacid author

Hi, in before record add, i want to put a control in the date field,

the date must to be in this range 10 days less or plus from now.

How can i do this?

A
ann 8/9/2010

Simone,
here is a sample code to check date range (Before record added event on the Events tab):

if (($values["DateField"]>date('Y-m-d',strtotime("+10 day")))&&($values["DateField"]<date('Y-m-d',strtotime("-10 day")))){

return false;

}

else {

return true;

}



where DateField is your actual date field name.