D
D
del9937882015-09-26 21:10:17
PHP
del993788, 2015-09-26 21:10:17

How to send nouislider values?

Hello. I've been trying to build a feedback form for about two months now and it so happened that I deleted js and php files... Yes, this happens too). I tried to compile it back, but now, for some reason, nouislider values ​​do not come ... I feel that there is an error somewhere, but I can’t find it ... Help me figure it out. See:
1. The slider itself, as well as the minimum and maximum values.

<div id="slider-snap"></div>
<span id="lower"></span>
<span id="upper"></span>

I don't remember how he passed values ​​through span. But through the fact that it was a span, I'm sure. html I did not delete)
2. js slider line was taken from the site nouislider. There doesn't seem to be anything out of the ordinary here...
var snapSlider = document.getElementById('slider-snap');

noUiSlider.create(snapSlider, {
   start: [ 0, 50 ],
   snap: true,
   connect: true,
   range: {
      'min': 0,
      'max': 100
   }
});

var snapValues = [
   document.getElementById('lower'),
   document.getElementById('upper')
];

snapSlider.noUiSlider.on('update', function( values, handle ) {
   snapValues[handle].innerHTML = values[handle];
});

I don't remember how I sent it. It flew out of my head. I only remember that it was very easy. There were no crutches.

PS I remember only the last three letters))))

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Talga UTB, 2015-09-26
@talgautb

add an input (hidden for example) and add value there from your slider :)

M
matperez, 2015-09-26
@matperez

What values ​​do you want to pass and where? In the event handler of the update event, you can get the current value of the slider, and what to do with it further from your example and question is completely unclear.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question