Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9202111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:10:45+00:00 2026-06-17T23:10:45+00:00

I have a fairly simple form with a single HTML5 range element in it

  • 0

I have a fairly simple form with a single HTML5 range element in it (being rendered as a slider). The code for that looks like this:

<form name="redform" id="redform" action="/">
    <input id="id"        name="id"        type="hidden" value="<?php echo $row['id']; ?>" />
    <input id="sliderRed" name="sliderRed" type="range"  value="<?php echo $data[5]; ?>" min="0" max="255" />
</form>
<p class="note">Current value: <span id="redValue">0</span></p>
<div style="text-align:center; color:#FF0000" id="redresults"></div>

Accompanying this is some jQuery that executes an external php script whenever the slider is moved:

$(function(){
    var redValue = $('#redValue');
    $('#sliderRed').change(function(){
        redValue.html(this.value);
    }); 
    $('#sliderRed').mouseup(function(){
        $.post('process.php',  $("#redform").serialize(), function(data) {
            $('#redresults').html(data);
            $('#redresults').fadeIn('slow').delay(2000).fadeOut('slow');
        });
    });
    $('#sliderRed').change();
});

All of that works. I can move the slider around, the value updates live, and the PHP script is run when the slider is released. Here’s what’s weird. The max and min values for the range slider are set to 0 and 255. However, sometimes, when dragging the slider all the way to one end, it will only hit 1 or 254. There doesn’t seem to be any pattern to when this happens. Sometimes it goes to the full range, sometimes it can’t go all the way. This is even the case while keeping you mouse held down and dragging it back and forth.

If the max and min are changed to 256 and -1 respectively, similar behavior is observed. Sometimes it will max out at 256, and sometimes it will max out at 255. On the bottom end, it will sometimes hit -1, and sometimes it can only be dragged down to 0. This indicates to me that it doesn’t have to do with actual numbers, but with some weird “off-by-one” bug.

Any thoughts on this? I’m totally stumped…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:10:46+00:00Added an answer on June 17, 2026 at 11:10 pm

    While the suggestions provided are great (thanks Jason). It’s worth explaining why this issue actually occurs. I submitted this as a bug to the chromium bug tracker thinking it might be a chrome bug. I was half right. See the post here: http://code.google.com/p/chromium/issues/detail?id=171362

    The issue is that if the slider is not at least 256 pixels long, then it’s impossible for all the values to be selectable. Using CSS, you can change the width to 256px, which eliminates the issue I described in my question.

    <input id="sliderRed" name="sliderRed" stlye="width:256px;" type="range"  value="<?php echo $data[5]; ?>" min="0" max="255" />
    

    However, this limitation makes using jQuery-UI a preferred solution, and what I will probably end up implementing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a fairly simple if else statement in C# that looks something like
I have a fairly simple web2py form with a few validators like, IS_FLOAT_IN_RANGE(...) on
Fairly simple question. I have a text field in a form that I would
I have a fairly simple login form that is submitted with a jQuery AJAX
I have a fairly simple form with a checkbox, and I noticed that my
I have a fairly simple block of code. Sub Run(Name) on error resume next
I have a fairly simple python loop that calls a few functions, and writes
I have a fairly simple Linq query (simplified code): dim x = From Product
I have a fairly simple math operation I'd like to perform on a array.
I have a fairly simple class that I want to save to SQL Server

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.