Page 1 of 1

Automatic fill fields / Calculated fields in ADD / EDIT

Posted: Tue Sep 17, 2013 11:16 pm
by jjmendez

Hello, good day, I have a couple of questions:

1) In functions EDIT / ADD, as I can fill a field with a combo values ​​that belong to another field? Example, the combo is in field 1 and have the values ​​A, B, C, on the same line, at the time of the click I want that field 1 is filled with 'A' field 2 with 'B' and the field 3 with 'C'. is it possible?

2) I wish that field 1 = date () - field X, (substrac days), as I can do?

Using: Trial PHPMaker 10.0.1

Thanks!


Re: Automatic fill fields / Calculated fields in ADD / EDIT

Posted: Wed Sep 18, 2013 10:20 am
by mobhar

Re: Automatic fill fields / Calculated fields in ADD / EDIT

Posted: Wed Sep 18, 2013 10:22 am
by danielc
  1. you can use explode to extract your selection. See php.net/manual/en/function.explode.php. So, you can put your array to fill in other fields in Row_Inserting server event (for add):
    $rsnew["yourfield"] = $yourarray[I];

Similarly for Row_Updating server event for edit.

  1. If you want to minus how many days from today, you can try this:
    $rsnew["yourfield"] = date("Y-m-d", strtotime("-14 day")); // try to replace with your variable

Re: Automatic fill fields / Calculated fields in ADD / EDIT

Posted: Thu Sep 19, 2013 11:39 pm
by jjmendez

danielc, mobhar, thanks for yous answers; try them .