Support » Plugin: Calculated Fields Form » Define Predefined Value in a Slider with fieldnames

  • Resolved Graicifyd

    (@graicifyd)


    I have a slider ‘fieldname1’

    The min value is ‘fieldname2’ and the max value is ‘fieldname3’.

    How can I set a predefined value without using a number since the min and max are variable. For instance, if I want the predefined value to be ‘fieldname2+5’?

    Would that be possible?

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

    (@codepeople)

    Hello @graicifyd

    You cannot use operations in the fields’ attributes. If you want to assign a value to the slider field by programming, you will need a calculated field (you can configure the calculated fields as hidden by ticking a checkbox in their settings).

    For example, you can insert a calculated field in the form, with the equation:

    getField(1).setVal(fieldname2+5);

    The getField operation requires the numeric component of the field’s name (In this case, the number 1 because the slider field is the fieldname1) and returns an object representation of the field. The setVal method of the field’s object assigns a value to it.

    Best regards.

    Thread Starter Graicifyd

    (@graicifyd)

    Oh,

    Thank you so much.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.