1

I am getting the [object object] instead of the initial value in the jquery slider. I have read a few posts on SO, and have placed the script right before the closing tags, but the slider is still not initializing.
JS FIDDLE

$("#slider").slider({
  value: 5,
  min: 25,
  max: 150,
  step: 5,
  slide: function(event, ui) {
    $("#fee-amount").val("$" + ui.value);
  }
});

$("#fee-amount").val("$" + $("#slider").slider("value"));
<form id="payment-fee">
  <div class="form-group">
    <label for="fee-amount">Load Amount:</label>
    <input type="text" id="fee-amount" value="" />
  </div>
  <div class="row">
    <div class="col-xs-6 col-sm-6 pull-left text-left">
      <span>$25</span>
    </div>
    <div class="col-xs-6 col-sm-6 pull-right text-right">
      <span>$150</span>
    </div>
  </div>

  <div id="slider"></div>
</form>

here is a screenshot as well. How can I initialize the slider? Thanks.

enter image description here

1 Answer 1

1

Use the following

$( "#fee-amount" ).val( "$" + $( "#slider" ).slider( "value" ) )

Here is working jsFiddle

See http://api.jqueryui.com/slider/#method-value

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.