Q:

jquery slider tooltip does not update on textbox change

i have a jquery slider control with a tooltip. user can either slide to change value which adjusts the tooltip, or the user can enter the value in the textbox and the slider and tooltip should adjust value in the textbox.
see attached jfiddle http://jsfiddle.net/k2sarah/caUku/2/.
<div id='slider'></div>
<div id='slider2'></div>
<input id='t1' type='text' />       

var initialValue = 2012;

var sliderTooltip = function(event, ui) {
    var curValue = ui.value || initialValue;
    var target = ui.handle || $('.ui-slider-handle');                                     
    var tooltip = '<div class="tooltip"><div class="tooltip-inner">' + curValue +
         '</div><div class="tooltip-arrow"></div></div>';   
   $(target).html(tooltip);

 }

    $('#t1').change(function () {
    var value = $('input[id$=t1]').val();
    $("#slider").slider("value", parseInt(value));
                    sliderTooltip;
    });

    $("#slider").slider({
    value: initialValue,
    min: 1955,
    max: 2015,
    step: 1,
    create: sliderTooltip,
    slide: sliderTooltip

 });

    var sliderTooltip1 = function(event, ui) {
        var curValue1 = ui.value || initialValue;
         var target = ui.handle || $('.ui-slider-handle');
        var tooltip = '<div class="tooltip"><div class="tooltip-inner">' + curValue1 +  
        '</div><div class="tooltip-arrow"></div></div>'; $(target).html(tooltip);
    }

    $("#slider2").slider({
        value: initialValue,
        min: 1955,
        max: 2015,
        step: 1,
        create: sliderTooltip1,
        slide: sliderTooltip1
    });

following code adjusts the value of slider but not cause tooltip value to be reflected to current slider value.
$('#t1').change(function () {
var value = $('input[id$=t1]').val();
$("#slider").slider("value", parseInt(value));
                sliderTooltip;
});

any help would be appreciated.
thks
ken

A:

Too many errors in your fiddle, should be:
$('#t1').change(function () {
    var value = $('input#t1').val();
    $("#slider1").slider("option", "value", parseInt(value, 10));
    sliderTooltip();
});

EDIT:
added change event to update handle value as well:
change: function (event, ui) {
    $(".tooltip-inner", this).html(ui.value);  /*thanks rusIn */

and you can add following to slide: to reflect changes in the input field also:
$('#t1').val(ui.value);

see working fiddle

