I have the following code for slider
<div id="test"></div>
<p:inputText value="#{observerMBean.rating.scale}" id="amount" style="width:30%;">
<f:convertNumber minFractionDigits="2" />
</p:inputText>
$( function() {
$( "#test" ).slider({
range: true,
min: 1,
step: 0.1,
max: 5,
value:0,
slide: function( event, ui ) {
$( "#amount" ).val( ui.values[ 1 ]);
}
});
} );
I am facing 2 problems
I do not want a range, if I set range to 'min' or 'max' I get the following error "Uncaught TypeError: Cannot read property '1' of undefined". How to solve that?
If I need 5 sliders in the same page how can I set the value to text boxes without using id.
Using this resolved my issue
$( "#amount" ).val( ui.value);