I've tried several different ways, including resetting the value of the slider back to 50 if it's ever dragged to 51 or beyond. It may be that I didn't implement the syntax for the Javascript correctly but neither that nor any of the other code I have found online that tries to manipulate the value of a slider seems to work.
Is there a way to do this? Ideally some jQuery on the question for the UI of the slider would not even allow the handle on the slider to be dragged beyond 50 at all, but if that's not possible, then just some lines of code that works to both get and set the value of the slider (so that I can trigger it if the value of the slider goes beyond 50, to reset back to 50) would be great. Thanks!
Below, I can't find where I originally got this from online, but I tried this:
`jQuery(".ResultsInput").slider({
range: "min",
min: 0,
max: 100,
value: 50,
step: 50,
slide: function(event, ui) {
if (ui.value > 50) {
return false;
}
}`
Best answer by DRRTGCC
View original