[UI SLIDER] Ui slider with text box input (ok)
PreviousKeep URL unaffected when anchor link is clicked (ok)Next[SELECT2] version Select2 3.5.3 nhìn trực quan hơn (ok)
Last updated
Last updated
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Slider - Range slider</title>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script type="text/javascript">
$( function() {
$( "#slider-range" ).slider({
range: true,
min: 0,
max: 500,
values: [ 0, 300 ],
slide: function( event, ui ) {
$( "#amount1" ).val(ui.values[ 0 ]);
$( "#amount2" ).val( ui.values[ 1 ] );
}
});
$( "#amount1" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) + " -- $" + $( "#slider-range" ).slider( "values", 1 ) );
$( "#amount2" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) + " -- $" + $( "#slider-range" ).slider( "values", 1 ) );
} );
</script>
</head>
<body>
<p>
<form action="http://localhost/php" method="GET">
<label for="amount">Price range:</label>
<input type="text" id="amount1" name="amount1" style="border:0; color:#f6931f; font-weight:bold;">
<input type="text" id="amount2" name="amount2" style="border:0; color:#f6931f; font-weight:bold;">
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</p>
<div id="slider-range"></div>
<?php
if(isset($_GET)) {
echo '<pre>';
var_export($_GET);
echo '</pre>';
}
?>
</body>
</html>