Automatically add date after checkbox checked |
1/11/2008 12:38:29 PM |
PHPRunner General questions | |
E
ewold author
Hi, i was trying to figure out how to set a date field to today but only if a checkbox completed is checked in the edit or add record page. Inline editing and adding is disabled. |
|
J
|
Jane 1/14/2008 |
Hi, $values["completed_date"]= now(); |
E
|
ewold author 1/14/2008 |
Hi, you can set up completed_date value to now() in the Before record added or Before record updated events on the Events tab. Here is a sample:
If $values["Completed"]=1 and $values["Completed_Date"]=Null Then $values["completed_date"]= now();
|
J
|
Jane 1/15/2008 |
Hi, if ($values["Completed"]==1 && !$values["Completed_Date"]) $values["Completed_Date"]= now(); |
L
|
lbragg 1/28/2008 |
Jane- |
J
|
Jane 1/29/2008 |
Leo, if dict("Completed")=1 and isnull(dict("Completed_Date")) then dict("Completed_Date")= Now() end if |