Min Max slider to form

此生再无相见时 提交于 2019-12-31 04:16:04

问题


I presently have a search module that submits as a regular html form. In it, I currently fetch an absolute minimum and maximum value for products, for example 50 and 2500. Now I need to build a slider with two buttons (to select a range) and when the form is submitted, both these user-selected values need to be sent, preferrably as two different variables. I am not familiar with how to do such a thing, any ideas?

Thank you!

Edit: http://jqueryui.com/demos/slider/

This format would be ideal, however I was not able to even implement the slider, let alone send 2 values with it. If someone can help with implementation of the above slider, or suggest a different slider method it would be very helpful.


回答1:


Why weren't you able to implement the jQuery UI slider? Here are the steps I take to including jQueryUI plugins.

  1. Link to jQuery
  2. Link to jQueryUI
  3. Link jQueryUI stylesheet
  4. Create HTML

div id="slider">

5 . Create JS

$(function(){  
     $('#slider').slider({  
          min: 50,  
          max: 2500
     });     
});  

http://jsfiddle.net/aHFwP/



来源:https://stackoverflow.com/questions/7406297/min-max-slider-to-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!