Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Try this code :</p> <pre><code>&lt;!doctype html&gt; &lt;html lang="en"&gt; &lt;head&gt; &lt;meta charset="utf-8"&gt; &lt;title&gt;jQuery UI Slider - Range slider&lt;/title&gt; &lt;link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"&gt; &lt;script src="http://code.jquery.com/jquery-1.9.1.js"&gt;&lt;/script&gt; &lt;script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="/resources/demos/style.css"&gt; &lt;script&gt; $(function() { $( "#slider-range" ).slider({ range: true, min: 0, max: 500, values: [ 75, 300 ], slide: function( event, ui ) { $( "#amount" ).val( "$" + ui.values[ 0 ] + " - $" + ui.values[ 1 ] ); }, change: function(event, ui) { // when the user change the slider }, stop: function(event, ui) { // when the user stopped changing the slider $.ajax( { type: "POST", url: "searchrange.php", data: {"min" :ui.values[0],"max":ui.values[1]}, success: function (option) { alert("voted"); } }); } }); $( "#amount" ).val( "$" + $( "#slider-range" ).slider( "values", 0 ) + " - $" + $( "#slider-range" ).slider( "values", 1 ) ); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;p&gt; &lt;label for="amount"&gt;Price range:&lt;/label&gt; &lt;input type="text" id="amount" style="border:0; color:#f6931f; font-weight:bold;"&gt; &lt;/p&gt; &lt;div id="slider-range"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>And your search page will be like this :</p> <pre><code> if(isset($_POST['min']) &amp;&amp; $_POST['min'] != '') { $kws = $_POST['min']; $kws1=$_POST['max']; echo $kws; echo $query = "select * from newusers where Age between '".$kws."' and '".$kws1."'" ; $res = mysql_query($query); $count = mysql_num_rows($res); $i = 0; if($count &gt; 0) { echo "&lt;ul&gt;"; while($row = mysql_fetch_array($res)) { echo "&lt;a href='#'&gt;&lt;li&gt;"; echo "&lt;div id='rest'&gt;";?&gt; &lt;a href="searchrange.php?id=&lt;?php echo $row['0'];?&gt; "&gt;&lt;?php echo $row['Religion'];?&gt;&lt;br&gt;&lt;?php echo $row['Name'];?&gt;&lt;/a&gt; &lt;?php echo $row[0]; echo "&lt;br /&gt;"; echo "&lt;br /&gt;"; echo "&lt;div style='clear:both;'&gt;&lt;/div&gt;&lt;/li&gt;&lt;/a&gt;"; $i++; if($i == 5) break; } echo "&lt;/ul&gt;"; if($count &gt; 5) { echo "&lt;div id='view_more'&gt;&lt;a href='#'&gt;View more results&lt;/a&gt;&lt;/div&gt;"; } } else { echo "&lt;div id='no_result'&gt;No result found !&lt;/div&gt;"; } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload