slider using fields for minimum and max value

  • 1
  • Question
  • Updated 3 months ago
  • Answered
Hi guys I have the JS needed to create sliders, but JS noob that i am, wondering if there is  way to use existing fields in same model to set the minimum and max value

So example below I want to replace:
the min value(1.001) with a field named min_cost__c
the max value(1.999) with a field named max_cost__c

anyone would be kind enough to help me with this please?

var params = arguments[0],
$ = skuid.$;
var field = arguments[0],   
    value = arguments[1],
    $ = skuid.$;
if (field.mode == 'read') {,value);
} else if (field.mode == 'edit') {
    var amt = $('<div class="nx-fieldtext">')
        .text({ value: value || '0' }));
    // Render a jQuery ui slider 
    // with step size 1 and boundary range [0,10].
    // Whenever this slider is updated,
    // our row will be updated as well
    var slider = $('<div>').slider({
        value:value || 0,
        min: 1.001,
        max: 1.999,
        step: 0.001,
        slide: function( event, ui ) {
            // Update our model with the new value
                { initiatorId : field._GUID}
            amt.text({ value: ui.value,
            decimalPlaces: 3
    var sliderContainer = $('<div>').append(amt,slider);

Photo of Dave


  • 5,630 Points 5k badge 2x thumb

Posted 3 months ago

  • 1
Photo of Bill McCullough

Bill McCullough, Champion

  • 13,008 Points 10k badge 2x thumb

If the fields 'min_cost__c' and 'max_cost__c' are on the same row, you can pull those values from the 'field' variable you have set.  Like so....

        min: field.row.min_cost__c,
        max: field.row.max_cost__c,



Photo of Dave


  • 5,630 Points 5k badge 2x thumb
thank you so much Bill, that worked like a charm!

Appreciate your help