Editable calculated fields

huggi

New member
Hi Eugenio,

maybe I have missed something obvious, but I am stuck. I try to create a form, where a field is filled with a value based on the values of another field. But the calculated field has to remain editable for the user.
Example: There is a text field called Product_Name. The next field is Extended_Product_Name, which should be populated automatically with the value of Product_Name. The user can leave it like that or can extend the Name with any text.

I have tried calculated fields, but then the field isn´t editable anymore. I have also tried a validation function that just writes the Product_Name into a global variable and then tried to read this variable in a default_value function for Extended_Product_Name. But the default value is only calculated upon opening the form.

Is there a way to re-trigger the default_value function while editing the form? Or do you have any other solution?

Thanks for the help.

Cheers,
Michael


---------------
Your current DaDaBIK version
You are using DaDaBIK version 10.0-Manarola enterprise, installed on 12-25-2019 (installation code: 0), the latest version of DaDaBIK is 10.0-Manarola released on 12-12-2019

You are runnning the last release of DaDaBIK

In case you want to upgrade to a more powerful edition (from Pro to Enterprise/Platinum, from Enteprise to Platinum) please contact us.

System info
PHP Version: 7.0.33-1~dotdeb+8.1

mysql version: 5.7.25

Web server: Apache/2.4.25 (Debian)

Client: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.87 Safari/537.36
 

eugenio

Administrator
Staff member
Hello Michael,
calculated fields in DaDaBIK are disabled, users can't edit them.

More in general, I don't think there is a perfect solution to this problem: if you enable editing, what happens if, after the user edits the field, the input fields (the ones belonging to the "formula") change? Should the calculated field be updated again, overriding the value inserted manually by the user? I don't think this would be easy understandable by the final users.

Default values, as you probably already experienced, work differently: you get a (optionally, calculated) default value when the form is opened and then the user can change the value.

Best,
 
Top