Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery set <input type="range"> value

Update: This was a bug which has been fixed by now (Chrome 18).


I have a <input type="range"> and I'm trying to set its value by jQuery. That basically doesn't do anything.

Then, I tried hiding/showing as I thought it would be a drawing problem, but to no avail did I so.

Lastly, I hid the <input> and showed it using show(1), which would mean a fading-in of 1ms. This did set the value, however after doing so the <input> isn't draggable anymore.

I made this fiddle up: http://jsfiddle.net/MhDf7/2/.

Does anybody have an idea of what's going on here? I'm using Chrome 10.

like image 849
pimvdb Avatar asked Mar 13 '11 15:03

pimvdb


1 Answers

It seems to be a browser bug. The exact same thing happens when using MooTools (DEMO) or when using vanilla JavaScript (DEMO).

However, even if the display isn't updated, the form still submits the correct value.

You might want to fill a bug report... On your jsFiddle page, do the following:

  1. Click the Page menu .
  2. Select Report a bug or broken website.
  3. Choose an issue type from the drop-down menu. The web address of the webpage you're on is recorded automatically.
  4. If possible, add key details in the 'Description' field, including steps to reproduce the issue you're experiencing.
  5. Keep 'Send source of current page' and 'Send screenshot of current page' checkboxes selected.
  6. Click the Send report button to report a Google Chrome bug.
like image 95
Andrew Moore Avatar answered Oct 16 '22 05:10

Andrew Moore