Conditional field fill - If/Then?

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
rdmiddleton
Posts: 7
Joined: 2013-08-15 13:08

Conditional field fill - If/Then?

Post by rdmiddleton » 2013-08-15 13:20

I have a form with several boxes for initials and date for each step completed. I would like for the date to autofill (current date) when the "initials"(completed by) field is completed.
Ex:
Step1 Completed by ____ On __/__/__
Step2 Completed by ____ On __/__/__
Step3 Completed by ____ On __/__/__
Different people are responsible for each step.

Something like:
Before
If step1 completed by = ""
After
If step1 completed by <>"" then step1 completed on = 'current date'

Any thoughts on how to accomplish this?

User avatar
a.gneady
Site Admin
Posts: 1354
Joined: 2012-09-27 14:46
Contact:

Re: Conditional field fill - If/Then?

Post by a.gneady » 2013-09-23 00:44

Try using the tablename_before_update hook for this ... for example:

Code: Select all

if($data['step1_completed_by'] != ''){ $data['step1_date'] = date('Y-m-d'); }
:idea: AppGini plugins to add more power to your apps:

Post Reply