0

I have a simple jquery slider, where I would like to update max:value by entering the amount in input field. Here is what I have so far:

<input name="cost" type="text" class="inputbox" size="10" id="cost" />

<label for="status">Progress Bar:</label>
    <input type="text" id="status" style="border:0; color:#158FB6;font-weight:bold; background-color:#F8F8F8" name="status"/>
    <div id="status-range" style="width: 250px;margin-top:2px"></div>

$(function() {
    $( "#status-range" ).slider({
        value:0,
        min: 0,
        max: 0,
        slide: function(event, ui) {
            $("#status").val("$" + ui.value);
        }
    });
    $("#status").val("$" + $("#status-range").slider("value"));
});

Now when user enters value in cost field I want max:0 to be updated automatically.

Alex
  • 1
  • 1

1 Answers1

1

Add this event listener:

$('#cost').change(function() {
  $('#status-range').slider('option','max',$(this).val());
});
js1568
  • 7,012
  • 2
  • 27
  • 47
  • Thank you but your solution does not work. I want to be able to control max value by entering in cost field – Alex Jun 16 '11 at 17:20