【发布时间】:2012-07-13 10:08:52
【问题描述】:
嘿朋友们。 我从选择框(html)中获取最大值和最小值时遇到问题。 我想使用 jquery 或 javascript 从选择框中获取 MAX AND MIN 值。
这是标记,简单的范围滑块。
$('#slider').slider({
range: true,
min: 0,//HERE I WANT TO GET VALUES
max: 40,
step: 10, // Use this determine the amount of each interval
values: [ 20, 40 ], // The default range
slide: function( event, ui ) {
// for input text box
$( "#amount" ).val( ui.values[ 0 ] + " - " + ui.values[ 1 ] );
// Display and selected the min Price
$( "#my_min" ).val(ui.values[ 0 ]);
// Display and selected the max Price
$( "#my_max" ).val(ui.values[ 1 ]);
}
});
我想从选择框中获取它们,选择框将由 PHP 动态填充。 代码如下:
<select id="my_min" class="price_range">
<?php //dynamicly filled options
while($row=mysql_fetch_array($query))
{echo "<option>".$row['values']."</option>";}
?>
</select>
感谢您的帮助。
【问题讨论】:
-
你能发布“选项”标签标记吗?
标签: php jquery-ui jquery-ui-slider