Automatic fill fields / Calculated fields in ADD / EDIT

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
jjmendez
User
Posts: 2

Automatic fill fields / Calculated fields in ADD / EDIT

Post 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!


mobhar
User
Posts: 11777

Post by mobhar »


danielc
User
Posts: 1601

Post 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

jjmendez
User
Posts: 2

Post by jjmendez »

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


Post Reply