Sliders with buttons +/-

More
3 years 3 months ago #112168 by oikos
oikos created the topic: Sliders with buttons +/-
Please, how can I add buttons +/- to sliders? Example in attachment. Thanks!
Attachments:

Please Log in to join the conversation.

More
3 years 3 months ago #112211 by oikos
oikos replied the topic: Sliders with buttons +/-
Please, can someone help?
Is it possible to do this?

Sometimes the precision on sliders when the minimum-maximum range of numbers is very large, is not easy to set the desired value. Then, the buttons +/- would be very useful.

Tony, please, could you give me some suggestion?

Thanks in advance.

Please Log in to join the conversation.

More
3 years 3 months ago #112361 by tpartner
tpartner replied the topic: Sliders with buttons +/-
I've added a "Sliders With Control Buttons" plugin to the workarounds section - manual.limesurvey.org/Workarounds:_Quest...With_Control_Buttons


.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: oikos

Please Log in to join the conversation.

More
3 years 3 months ago #112367 by oikos
oikos replied the topic: Sliders with buttons +/-
Tony, many congratulations and thank you very much for the great work you've done.

Just one thing, when I set the "Equals sum value", when I use the Control Buttons, "Remaining" and "Total" do not change dynamically. Also, the message "The sum must equal 100" does not appear when "Minimum answers" is specified ?

Thanks again!
Attachments:

Please Log in to join the conversation.

More
3 years 3 months ago #112392 by DenisChenu
DenisChenu replied the topic: Sliders with buttons +/-
Hi,

I think Tony must add some 'trigger' somewhere to allow Expression Manager do his job.

@Tony : great workaround, i really think it must be included (wth option) in future release (2.1 for example).

Actually i have some example to put some javascript workaround in plugin : www.limesurvey.org/en/extensions/75-hideemptycolumn
This one in plugin can be great.
And I think we can replace default javascript function in plugin too (just use same function name), must give a try.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: oikos

Please Log in to join the conversation.

More
3 years 3 months ago #112417 by tpartner
tpartner replied the topic: Sliders with buttons +/-
@oikos, as Denis suggested, I have added triggers on the inputs so all EM functionality should work now. I have also added options for the call-out prefix and suffix (if used in the question settings, you need to define these in the jQuery plugin call because the plugin does not have access to the JSONized data for the sliders). New survey and template are uploaded to the workarounds section .

@Denis, when I have time, I'll look into plugging the plugin into a plugin :laugh:


.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: oikos

Please Log in to join the conversation.

More
3 years 3 months ago #112418 by DenisChenu
DenisChenu replied the topic: Sliders with buttons +/-

tpartner wrote: @Denis, when I have time, I'll look into plugging the plugin into a plugin :laugh:

I have to test, but i think we can just registerScriptFile with same function name to replace all included javascript.

Then : we need an event for Expression Manager hide/show and addClass/removeClass
;)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: oikos

Please Log in to join the conversation.

More
3 years 3 months ago #112419 by tpartner
tpartner replied the topic: Sliders with buttons +/-

I have to test, but i think we can just registerScriptFile with same function name to replace all included javascript.

Yeah that should work as long as it's loaded after the core script - like "POS_END".

In my opinion, we would not want it applied globally so need question settings for:
- Use buttons
- Up text
- Down text
- Enable scrolling
- Scrolling interval



.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: oikos

Please Log in to join the conversation.

More
3 years 2 months ago #112425 by oikos
oikos replied the topic: Sliders with buttons +/-
@Tony, this is a nice and great workaround!

Just another thing, when the "Slider accuracy" is a decimal (for example 0.5) "Remaining" and "Total" are not calculated correctly...

And CSS question: How could we reduce the vertical space between subquestions without misalign subquestion-text, slider and buttons?

Thank you very much! Best regards, Tony and Denis!

Please Log in to join the conversation.

More
3 years 2 months ago - 3 years 2 months ago #112430 by tpartner
tpartner replied the topic: Sliders with buttons +/-

Just another thing...

Sorry, I have already volunteered far too much time on this. If you want to push it for all of the possible slider permutations, someone else will have to take over.

And CSS question...

That depends entirely on the template. I suggest a tool like Firebug for Firefox to explore what styles are affecting the layout.


.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last Edit: 3 years 2 months ago by tpartner.
The following user(s) said Thank You: oikos

Please Log in to join the conversation.

More
3 years 2 months ago #112434 by tpartner
tpartner replied the topic: Sliders with buttons +/-

...when the "Slider accuracy" is a decimal (for example 0.5) "Remaining" and "Total" are not calculated correctly...

Seems to work fine for me.

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Attachments:
The following user(s) said Thank You: oikos

Please Log in to join the conversation.

More
3 years 2 months ago #112443 by oikos
oikos replied the topic: Sliders with buttons +/-
Hi, Tony!

All right. I'm sorry. Maybe it can be a problem for the default language (Spanish in my case) in which the sign in Spanish for decimal separator is the comma and the point does not get in the calculation. Where could I change the sign for decimal separator?

Anyway, it was a nice and very useful plugin and you've done a great work.

Thank you very much for everything!
Attachments:

Please Log in to join the conversation.

More
3 years 2 months ago #112446 by tpartner
tpartner replied the topic: Sliders with buttons +/-
Oh, I see. I have uploaded a new version of the template with a fix for the decimal separator and number of decimal places - manual.limesurvey.org/images/d/dd/Demo_Slider_Buttons.zip

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: oikos

Please Log in to join the conversation.

More
3 years 2 months ago #112474 by DenisChenu
DenisChenu replied the topic: Sliders with buttons +/-

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
The following user(s) said Thank You: oikos

Please Log in to join the conversation.

More
3 years 2 months ago #112481 by oikos
oikos replied the topic: Sliders with buttons +/-
Tony and Denis, the last version of the template with a fix for the decimal separator and number of decimal places works perfectly! Tony, it's awesome the excellent work you've done.

Sincerely thanks again!

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!