• Resolved andyro

    (@andyro)


    Hi, I am interested in linking two sliders, but I do not know if it is possible. As a building size slider goes up to 20,000, the fee slider should go down from 5% (predefined) to 3%. As the building size goes down to 500, the fee should slide up to 8%.

    Is there a way to modify a parameter/slider based on the value of another slider? Thanks in advance!

    The page I need help with: [log in to see the link]

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

    (@codepeople)

    Hello @andyro

    Are you talking about the max value of “Performance/Eco Premium (% of Net Construction Cost)” slider or its value?

    I’m not totally sure about your request. However, if you want the value of the fieldname14 field to be 8 if the value of the fieldname7 field is less than or equal to 500, and 3 if the value of the fieldname7 field is great than or equal to 20000. Insert a calculated field as an auxiliary (you can hide this field by ticking a checkbox in its settings) with the equation:

    
    (function(){
        var A = fieldname7, result;
        if(A <= 500) result = 8;
        if(20000 <= A) result = 3;
    
       getField(14).setVal(result);
    })()
    

    Best regards.

    Thread Starter andyro

    (@andyro)

    Amazing – thank you! Will try. This should do what I was after, plus I saw another response under ‘advanced equation’ that had a series of values, so will try that also! I wasn’t aware any other field but a calculated field could do a calculation, so the code snippet above is primo!

    Plugin Author codepeople

    (@codepeople)

    Hello @andyro

    Actually, with the calculated fields, you can control practically every other field in the form.

    Best regards.

    Thread Starter andyro

    (@andyro)

    Hi, so I tried it – works like a charm. Test is at the bottom of this page: https://www.thomsonarchitecture.ca/calculators/ under: MODIFIED PARAMETER SLIDER TEST

    I have a followup question. How can I make just the fieldname5 slider read only? Or, better yet, how can I get fieldname5 to dynamically be tied to fieldname4 (building size), so the two sliders are locked together? Right now, slider 4 modifies slider 5, but slider 5 does not modify slider 4. Do I just add another bit of code in the calculated field to make it do the reverse?

    Or is there a more elegant way? Also, the percentage range is not displayed under the lower left of fieldname5, only the lower value of the number pair range (ie. “10”) – is there a way to show it as “10-12%” for example? Thanks again for your help!

    • This reply was modified 4 years, 4 months ago by andyro.
    Plugin Author codepeople

    (@codepeople)

    Hello @andyro

    In your project, there is not a direct relationship between the sliders. The values of the slider A must be transformed to the scale of the slider B, and vice versa. So, there is no way to do it only by configuring the fields.

    Please, if you need a custom coding service, do not hesitate to contact me through my private website, describing the equivalence between the values in the slider A and B, in both directions: Custom coding service.

    Best regards.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Slider result modifies another slider’ is closed to new replies.