ghusse/jQRangeSlider — Issue #15: Editable labels
Author: CoDEmanX
Created: 2012-01-06 12:21:43+00:00
State: open

It would be really nice to have the labels editable, not HTML 5 editable, but rather input text fields without border and transparent background instead of pure text in the jquery ui labels:

keypresses of tab and enter as well as element blurring should apply the new value (after a validation of course!)

This would save me the need and space of two extra input fields (and i wouldn't need my messy code for it anymore *g*)

My current modifications:

function displayValues(slider, values){
var min_int = Math.round(values.min);
var max_int = Math.round(values.max);
$("#min1").val(min_int);
$("#max1").val(max_int);
}
I need integer values for year range input

$("#max1").bind('keypress', function(e){
if ( e.keyCode == 13 ) {
var input = $("#max1").val();
var output = input;
if (input < 1833) {
output = 1833;
} else if (input > 2011) {
output = 2011;
}

if (isNumeric(input)) {
$("#defaultSlider").rangeSlider("max", output);
}
}
});
});

function isNumeric(value) {
return !isNaN(parseInt(value)) && isFinite(value);
}

```

```
How can I obtain the currently set bounds of a slider? As you see above, i test for 1833 and 2011. I can update these values via PHP, but it would be nicer to supply the bounds once and do the rest in JS only.