formio.js icon indicating copy to clipboard operation
formio.js copied to clipboard

Calculated value will not overwrite manuall inserted data

Open masoodmehrabi opened this issue 8 years ago • 3 comments

Hi I have a select with oprions A,B and a text input which value is calculated based on selected option in Select component When I choose either of options A or B the text input value is set correctly But the problem is in scenario When I choose option A and text value will set correvtly and I manually enter new value in text input but before submitting the form I change select option to B but value of text input won't change and it remain the value I inserted manually and ignore the calculated value In the other words new calculated value does not overwrite manually entered value I thought "refreshOn" may can solve the issue but I could not use it or it is not working How I can solve this Issue ?

Regards

masoodmehrabi avatar Oct 29 '18 21:10 masoodmehrabi

Hello Samayool,

New calculated values not overwriting manually is by design because If a component is manually changed, it will no longer override with calculated values. If it did, there would not be a way of setting a value manually on a calculated field. If you do not want users to change the value of the field, you can set the field to disabled in the component settings.

Please let me know if you have any further questions or concerns.

Thanks,

wag110894 avatar Oct 30 '18 19:10 wag110894

Hi @wag110894

it seems that there's no guidelines on your documentation on how to change the number format on the Calculated value in number components ?

what i want is to change a specific number components into %

iv'e tried looking for the number Component but it seems that there's no function for that ? can you help me with this ?

Regards,

Nickolos16 avatar Nov 09 '18 07:11 Nickolos16

Hello,

You can simply add a “%” suffix at the end of the number field and set the decimals to 2. This will format the field like a percent.

Here is a screenshot of how to do this: https://www.screencast.com/t/0XyAMmpcaD

Please let me know if you have any further questions or concerns. Thanks!

wag110894 avatar Nov 09 '18 18:11 wag110894