Tell us what you are trying to do? I am trying to use custom js library to display custom field as input slider.
Is it possible, to display this shortcode:
[cred_field field='cislo-1' force_type='field' class='form-control' output='bootstrap' value='0']
like input with some classes:
<input id="ex8" data-slider-id='ex1Slider' type="text" data-slider-min="0" data-slider-max="20" data-slider-step="1" data-slider-value="14"/>
I am trying to use the bootstrap slider from here <link>hidden link;
It works for inputs. But is it possible to display cred_field as raw input?
Hello,
It needs custom JS codes, for example, the Toolset Form shortcode [cred_field ...] will output a HTML input tag, you can setup JS codes to add/modify the HTML attributes of input tag to what you want:
hidden link
I suggest you try to follow their document to setup those HTML attributes :
hidden link
section "Using bootstrap-slider (via data-provide-API)"
And I suggest you use "cred_form_ready" event to trigger your custom JS codes, see similar thread here:
https://toolset.com/forums/topic/limit-date-range-for-cred-form-date-field/
My issue is resolved now. Thank you!
Ok I tried to use it as you suggested:
jQuery(document).on('cred_form_ready', function() {
jQuery( "#cred_form_2207_2-textfield-1-1562228545" ).attr({
data-provide="slider",
data-slider-ticks="[1, 2, 3]",
data-slider-ticks-labels='["short", "medium", "long"]',
data-slider-min="0",
data-slider-max="30",
data-slider-step="1",
data-slider-value="1",
data-slider-tooltip="hide"
});
});
But it doesnt work. Any ideas?
Since it is a custom JS codes problem, please provide a test site with the same problem, also point out the problem page URL, I need to test and debug it in a live website. thanks