Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Sliders with buttons +/-

  • oikos
  • oikos's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 7 months ago #112168 by oikos
Sliders with buttons +/- was created by oikos
Please, how can I add buttons +/- to sliders? Example in attachment. Thanks!
The topic has been locked.
  • oikos
  • oikos's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 7 months ago #112211 by oikos
Replied by oikos on 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.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 7 months ago #112361 by tpartner
Replied by tpartner on 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
The topic has been locked.
  • oikos
  • oikos's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 7 months ago #112367 by oikos
Replied by oikos on 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:
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 7 months ago #112392 by DenisChenu
Replied by DenisChenu on 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 , plugin development .
I don't answer to private message.
The following user(s) said Thank You: oikos
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 7 months ago #112417 by tpartner
Replied by tpartner on 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
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 7 months ago #112418 by DenisChenu
Replied by DenisChenu on 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 , plugin development .
I don't answer to private message.
The following user(s) said Thank You: oikos
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 7 months ago #112419 by tpartner
Replied by tpartner on 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
The topic has been locked.
  • oikos
  • oikos's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 7 months ago #112425 by oikos
Replied by oikos on 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!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 7 months ago - 9 years 7 months ago #112430 by tpartner
Replied by tpartner on 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: 9 years 7 months ago by tpartner.
The following user(s) said Thank You: oikos
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 7 months ago #112434 by tpartner
Replied by tpartner on 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.
The following user(s) said Thank You: oikos
The topic has been locked.
  • oikos
  • oikos's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
9 years 7 months ago #112443 by oikos
Replied by oikos on 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!
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose