using jquery range slider have been trying values in hidden input field used search.
the hidden input field has same id slider fields value hidden ones done show anything!
$(document).ready(function() { $( "#sliderranger" ).slider({ range: true, min: 0, max: 500, values: [ 75, 300 ], slide: function( event, ui ) { $( "#amount1" ).val( "thb " + ui.values[ 0 ] ); $( "#amount2" ).val( "thb " + ui.values[ 1 ] ); var price1 = ui.values[ 0 ]; var price2 = ui.values[ 1 ]; //alert(price1 + " " + price2); $( "#price1" ).value = price1; } }); $( "#amount1" ).val( "thb " + $( "#sliderranger" ).slider( "values", 0 )); $( "#amount2" ).val( "thb " + $( "#sliderranger" ).slider( "values", 1 )); }); above js code if helps if need more info let me know , il see can .
hope 1 can can see on topic ??
the hidden input field has same id slider fields value
i hope don't mean there 2 elements same id attribute on same page. if so, you'll need change or you'll see unexpected results.
as setting value of hidden inputs slider results, looks you're close. line:
$( "#price1" ).value = price1; should changed to:
$( "#price" ).val(price1); here's code revised (and using visible input elements of type text instead of hidden): http://jsfiddle.net/andrewwhitaker/pyprr/
Comments
Post a Comment