4
<input type="range" min="2" max="52" value="4" step="1"/>

Can I have one of these input ranges with non-numeric intervals? Like "Yes" then "maybe" then "no"?

Thanks

1 Answer 1

2

The type range of html input is designed for imprecise input values.

Anyway, if you really want to use a slider for this purpose, you can maybe set on your script that 0 is no, 1 is maybe and 2 is yes. In jQuery, it would be something like this:

$("#slider").change(function(){
    switch($(this).val()){
        case "0":
          /* change a text/hidden value to 'no' */
          break;
        case "1":
          /* change a text/hidden value to 'maybe' */
          break;
        case "2":
          /* change a text/hidden value to 'yes' */
          break;
      }
}).change();

Live example: http://jsbin.com/upeyew

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.