Search code examples
jqueryjquery-uijquery-ui-slider

Validating range where minimum=maximum on jQuery slider


Currently my jQuery slider prevents the user from progressing if the range is 0-0 and 1000-1000. How do I make it work across a range of values such as 10-10,20-20,30-30...990-990 without having to define each manually.

Here is my code:

http://jsfiddle.net/xSkgH/46/

Thanks in advance!


Solution

  • http://jsfiddle.net/xSkgH/53/

    Basically just check whether your lower and upper values are the same

        if (lower == upper) {
            alert("Please select two different values");
        } else {
            $("#errorMessage").html("");
        }