IonDen / ion.rangeSlider

jQuery only range slider
http://ionden.com/a/plugins/ion.rangeSlider/en.html
MIT License
2.56k stars 508 forks source link

Cannot read property 'update' of undefined #755

Closed pRieStaKos closed 3 years ago

pRieStaKos commented 3 years ago

I got three Ion.RangeSlider on a WHMCS template and I cannot set one with min/max and disable and hide the other two with update.

image

Code: https://codeshare.io/6ppmvm

Ion.RangeSlider version 2.0.13 Build: 335 ( i cannot update).

Any suggestions on why update is returning error and won't update the sliders ?

IonDen commented 3 years ago

You need to double check that constructions like these slider = $('div[class^="opnmprimaryhighavailability' + $.trim(selected) + '"]').find('input').data("ionRangeSlider"); are returning to you instances of slider and not undefined

If it returns undefined - this means you are searching these elements wrong and need to debug this line of code.

pRieStaKos commented 3 years ago

You need to double check that constructions like these slider = $('div[class^="opnmprimaryhighavailability' + $.trim(selected) + '"]').find('input').data("ionRangeSlider"); are returning to you instances of slider and not undefined

If it returns undefined - this means you are searching these elements wrong and need to debug this line of code.

Issue is on first slider.update. Not the second slider. But min/max is set on 0, even with the console.error.

Capture

I want to disable the 2 hidden slider, so form is not posting their value on the next page. Even with disabled state, the slider's value is been posted.

IonDen commented 3 years ago

Not sure that do you mean, could you create the demo?

pRieStaKos commented 3 years ago

I managed to fix this. Reposition the custom script and its working, but form is still posting the disabled sliders. How can I prevent post of the disabled sliders ?

IonDen commented 3 years ago

It should not post disabled sliders in form. Please check this demo: https://jsfiddle.net/IonDen/esL4aqtp/

and double check that you do everything correctly.

pRieStaKos commented 3 years ago

Thank you. I found the solution. On WHMCS ionRangeSlider is disabled, but WHMCS wants the other slider values to be passed on the order form.