I want to tuser the JQuery UI Slider for having a centered slider with a minimum of -3 and a maximum of 3. Initial start of the handle should be 0.
I know that the JQuery UI Slider showsn here might be the script to use: hidden link
I have a cred form with various numerical inputs that I want to use this slider on.
HTML:
[credform class='cred-form cred-keep-original']
<div class="form-group">
<label>Hintergrundwissen zum Fachgebiet</label>
[cred_field field='fieldname' value='' urlparam='' class='form-control' output='bootstrap']
<div id="slider"></div>
</div>
[cred_field field='form_submit' value='Einsenden' urlparam='' class='btn btn-primary btn-lg' output='bootstrap']
[/credform]
I have tried this code but nothing happens:
$( function() {
$( "#slider" ).slider({
value:100,
min: 0,
max: 500,
step: 50,
slide: function( event, ui ) {
$( "#cred_form_217_1-textfield-11-1520511905" ).val( "$" + ui.value );
}
});
$( "#cred_form_217_1-textfield-11-1520511905" ).val( "$" + $( "#slider" ).slider( "value" ) );
} );
- Whats wrong with the code?The console says slider function is missing?
- Is it because JQuery UI is not active? How do I properly embed the according JQuery UI CSS and JS?
Sorry but this editor lacks markup to frame the code. Got no idea whats wrong here.