• Hi All,

    On my form for users to complete on the front end of my website, I have a field of type numeric called ‘price’.

    I want to add another field ‘Discount Price’ which is simply the price*0.8. This field will not be shown to users but just in the back end, so it is ok if the calculation is done after the user has submitted a record.

    Can I configure this in the default value for this field (in the manage database fields) or does it require some coding?

    Many Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Roland Barker

    (@xnau)

    Currently, it will require some custom code to do that. I have some example code to point you in the right direction.

    I am preparing a major update to Participants Database that includes this as a new feature, so if you don’t want to code it yourself, you can wait for the new release, it will be out within two weeks.

    If you want to do the code, take a look at this example. It’s for a different thing, but if you understand the code, it’s easy to adapt to your purpose.

    https://gist.github.com/xnau/1d66ca8e327e1655b32d69578c0e9e0b

    Thread Starter iainmathews

    (@iainmathews)

    Thanks for your response. I will await the update – I think this will be a really nice feature!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Creating a field with calculated value’ is closed to new replies.