• Resolved rosbiffer

    (@rosbiffer)


    Is it possible to use a field for the predefined value of a slider? The instructions say you can use them for setting the min and max and step but not the predefined value…

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

    (@codepeople)

    Hello @rosbiffer

    For the predefined value has no much sense, because you simply should to enter the value into the corresponding attribute of field’s settings.

    What do you want exactly?

    Best regards.

    Thread Starter rosbiffer

    (@rosbiffer)

    I have a value slider, with min and max set of 500 and 20,000. I’d like to set the predefined value as fieldname3/10 as long as it falls in that range or if not then something like 3000

    Plugin Author codepeople

    (@codepeople)

    Hello @rosbiffer

    The predefined value is the default value of the field, once the user varies it, the value would be the selected by the user.

    I don’t know who is fieldname3 in your form, but assuming the slider field is the fieldname123 you can insert a calculated field as auxiliary with the following equation:

    
    (function(){
        if(typeof global_flag == 'undefined')
        {
            var v = fieldname3/2;
            if(v<500 || 20000<v) v = 3000;
            getField(123).setVal(v); 
            global_flag = true;
        }
    })()
    

    and that’s all.
    Best regards.

    Thread Starter rosbiffer

    (@rosbiffer)

    Great thank you. I’ve realised that if I set a default for fieldname3 anyway then I don’t need to work out a different default for my slider!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Using field for predefined value of slider’ is closed to new replies.