views:

89

answers:

0
$(function() {
    $("#slider").slider({
        value:0,
        min:0,
        max: 10,
        step: 1,
        slide: function(event, ui) {
            $("#amount").val(ui.value);
                $("#price").val('$'+ ui.value * $("#rate").attr("value") * 12);
            }
        });
    $("#amount").val($("#slider").slider("value"));
    $("#price").val('$' + [VarName,S]);
});

HTML:

<div id="container">    
<div class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all" id="slider">
<a style="left: 0%;" class="ui-slider-handle ui-state-default ui-corner-all" href="#"></a></div>
<p>
<input id="rate" style="border: 0pt none; color: rgb(246, 147, 31); font-weight: bold;" type="hidden" value="[VarName,S]">
<label for="amount">Year:</label>
<input value="1" id="amount" style="border: 0pt none; color: rgb(246, 147, 31); font-weight: bold;" type="text">
</p>
<p>
<label for="price">Price:</label>
<input value="[VarName,S]" id="price" name="price" style="border: 0pt none; color: rgb(246, 147, 31); font-weight: bold;" type="text">
</p>
<a href="#"><img width="120" height="32" border="0" src="btn-add-cart-blue.png" alt="" /></a>
</div>

Question 1: How can i transfer the slider value to another page?

Question 2: I am using the price value in the slider from my previous page using the [VarName,S] variable. It shows the first time price value successfully as it brought from the previous page but once I slide forward and than slide back the value initiated to 0 instead of the value i carried from the previous page. How can I retain the min price value to the value i carried from the previous page?

Thanks for any help.