• Resolved odddic

    (@odddic)


    Hi author,

    Hope you’re great today.
    Is it possible to add button + – on slider field. So when click the + the slider value increased.

    Thanks,
    Ody

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @odddic,

    You cannot activate buttons in the slider field, however, you can insert them programmatically.

    I will assume in the code below that your slider field is the fieldname1 and there is only one form in your webpage.

    – Insert the following piece of code into the attribute: “Instructions for User” in the settings of the slider field:

    
    <input type="button" value="Prev" onclick="var e = fbuilderjQuery(this).closest('.slider-container').find('.slider'), v = e.slider('value'), s = e.slider('option','step'), m = e.slider('option', 'min');fbuilderjQuery.fbuilder.forms['_1'].getItem('fieldname1_1').setVal(MAX(v-s,m));" />
    <input type="button" value="Next"  onclick="var e = fbuilderjQuery(this).closest('.slider-container').find('.slider'), v = e.slider('value'), s = e.slider('option','step'), m = e.slider('option', 'max');fbuilderjQuery.fbuilder.forms['_1'].getItem('fieldname1_1').setVal(MIN(v+s,m));" />
    

    Note: if your slider field is for example the fieldname3 field, use fieldname3_1 in the previous piece of code.

    Best regards.

    Thread Starter odddic

    (@odddic)

    Hi Codepeople,

    Thanks so much for the answer. But I can’t make it works.
    There is no anything happen when I add the code.

    Can I add 2 “button” prev & next and add the code for working to slider?

    Thanks so much.

    Thread Starter odddic

    (@odddic)

    Hi codepeople,

    Your code works in button field.
    Thanks so much.

    Plugin Author codepeople

    (@codepeople)

    Hello @odddic,

    Thank you very much for letting me know the code is working properly with your buttons.

    Best regards.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add + – button on slider field’ is closed to new replies.