$this on multiple jquery ui slider's, giving undefined?

41 Views Asked by At

I am not a pro, it'll show in a second. I could initialize and separately handle multiple jquery UI sliders on a same page but when I try to do an ajax update on slider "stop:", if I refer to get my data-crunchid from the of the appropriate slider, to be able to do an update for that slider, it gives undefined.

Is there a way to be able to pass on the data-crunchid to the ajax update? I guess so and I'd like to know what did I miss. I can't refer to the ID of the input, since it has to be dynamic, via the $this, to know which slider provides the adjustment.

Appreciated!

1

There are 1 best solutions below

7
On BEST ANSWER

FIDDLE

You weren't referring to the appropriate element for the crunchid

I added var crunchElement = $(this).prev('.SliderText'); because crunchid is an attribute of .SliderText and not .RatingSlider