buttons to increase/deacrease numerical input (spinners)

Mehr
6 Monate 3 Wochen her #177576 von KompetenzZ
Hi,

I found this jquery widget with buttons to increase/decrease the current value: jqueryui.com/spinner/

I tried to integrate this widget in my multiple numerical input subquestions but I don't know how. When I copy the jquery code to the subquestion source of the multiple numeric input question, it creates a new input field (and this new input field does not have the increase/decrease buttons).

Can you give me please a hint how to integrate the increase/decrease buttons in the existing limesurvey input field?

See screenshot:

Cheers kompetenzz
Anhänge:

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

LimeSurvey Partners
Mehr
6 Monate 3 Wochen her - 6 Monate 3 Wochen her #177588 von DenisChenu
If you always use . for numerci separator, best is to create a views/survey/questions/answer/numerical/answer.twig in your theme copy pasted the original one but
replace C.Html.textField by C.Html.numberField

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .
Letzte Änderung: 6 Monate 3 Wochen her von DenisChenu.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 3 Wochen her #177663 von KompetenzZ
Hi,

I took the "answer.twig" file from there:

/home/[servername]/www/application/views/survey/questions/answer/numerical/answer.twig

and then I navigated to:

/home/[servername]/www/upload/themes/survey/[yourTemplateName]/views

and created there the sub folders:

/survey/questions/answer/

and pasted there the file "answer.twig" and changed in the file "C.Html.textField" to "C.Html.numberField".


What else do I have to do for these increase/decrease buttons? It seems that nothing has changed.

Cheers kompetenzz

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 3 Wochen her #177667 von tpartner
You should be in /upload/themes/question/, not /survey/.

Have a look at some of the question themes here (or in Denis' repositories) to see the file structure - github.com/tpartner

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 3 Wochen her - 6 Monate 3 Wochen her #177669 von DenisChenu

tpartner schrieb: You should be in /upload/themes/question/, not /survey/.

Have a look at some of the question themes here (or in Denis' repositories) to see the file structure - github.com/tpartner

No, no,

I talk for : replacing Core twig file ,

see gitlab.com/SondagesPro/SurveyThemes/acce...ons/answer/numerical

Then to ./upload/yoursurveytheme/views/survey/questions/answer/numerical/answer.twig

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .
Letzte Änderung: 6 Monate 3 Wochen her von DenisChenu. Begründung: complete dir name

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 3 Wochen her #177677 von KompetenzZ
Hi,


I took the "answer.twig" file from the link of your previous post and changed the "C.Html.textField" to "C.Html.numberField".

Then I navigated to:

/home/[servername]/www/upload/themes/survey/[yourTemplateName]/views

and created there the sub folders:

/survey/questions/answer/numerical

and placed the the new "answer.twig" file here.


Is this correct? It seems that nothing has changed. Attached is my theme.

Dateianhang:

Dateiname: extends1_b...2-02.zip
Dateigröße:190 KB

Cheers kompetenzz
Anhänge:

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 3 Wochen her - 6 Monate 3 Wochen her #177700 von DenisChenu
I don't say to take the one for accessible_vanilla

copy pasted the original one but


But seems ls didn't accept numberfield, is just a little more long

Work on all good browser …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .
Anhänge:
Letzte Änderung: 6 Monate 3 Wochen her von DenisChenu.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 3 Wochen her - 6 Monate 3 Wochen her #177713 von KompetenzZ
Well, thank you very much for adding the twig files for both questions "numerical input" and "multiple numerical input". That was a great help. As I have several multiple numerical questions, these are handy for persons who are less familiar with the keyboard. However, is there a way to increase the size of these increase/decrease buttons without increasing the size of the whole textbox? Because the buttons represent very small targets.
And I noticed that these buttons do not show on my smartphone (with the current firefox), but that's a minor thing.

Cheers kompetenzz
Letzte Änderung: 6 Monate 3 Wochen her von KompetenzZ.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 3 Wochen her - 6 Monate 3 Wochen her #177715 von KompetenzZ
P.S.: Sorry I just want to mention another issue: When the value in the input field does not comply with the max and the min value (which can be set in the input options of the (multiple) numerical question) then the whole inputs of the input fields are made empty again. So, when the answer does not comply with the min/max, the fields are empty again (after clicking "Next"). This is not the case, when I do not insert the twig files. See screenshots.

Screenshot without increase/decrease buttons (normal, tip is red):



Screenshot with increase/decrease buttons (empty and tip is not red)

Cheers kompetenzz
Anhänge:
Letzte Änderung: 6 Monate 3 Wochen her von KompetenzZ.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 3 Wochen her - 6 Monate 3 Wochen her #177728 von DenisChenu
Here, i just move from text input to number input : developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number

Browser must do the job : I think your firefox is outdated here.

But : seems there are an issue about javascript control : this must be rewritten differently … sorry :/

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .
Letzte Änderung: 6 Monate 3 Wochen her von DenisChenu.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 3 Wochen her #177729 von DenisChenu
OK,

A fixed template with the script inside custom.js

Dateianhang:

Dateiname: extends1_b...fix2.zip
Dateigröße:191 KB


Remind : it's only usage of developer.mozilla.org/en-US/docs/Web/HTML/Element/input/number

Nothing less, nothing more.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .
Anhänge:

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 2 Wochen her - 6 Monate 2 Wochen her #177827 von KompetenzZ
Thank you very much for all the help. Yes, firefox on smartphone works perfectly, I just had to realize that mobile browsers show a special keyboard and no increase/decrease buttons.

The link you provided is very useful.
If someone else ever needs this: After the part:
<input type="number"

in the twig files some settings can be added, especially a minimum and maximum can be set, so that the spinners cannot operate to undesired number ranges. Also a placeholder "0" at the begin can be displayed:
<input type="number"  min="0" max="100" placeholder="0"

Cheers kompetenzz
Letzte Änderung: 6 Monate 2 Wochen her von KompetenzZ.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
6 Monate 2 Wochen her #177841 von DenisChenu

KompetenzZ schrieb: Thank you very much for all the help. Yes, firefox on smartphone works perfectly, I just had to realize that mobile browsers show a special keyboard and no increase/decrease buttons.

The link you provided is very useful.
If someone else ever needs this: After the part:

<input type="number"

in the twig files some settings can be added, especially a minimum and maximum can be set, so that the spinners cannot operate to undesired number ranges. Also a placeholder "0" at the begin can be displayed:
<input type="number"  min="0" max="100" placeholder="0"

Yes, but before set this to LimeSurvey we need to remove or fix Expression Manager for usage of ',' in survey :).

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
5 Monate 2 Wochen her #179048 von KompetenzZ
Hi,

during the pre-test of a survey with these increase/decrease buttons we discovered that the numerical input (the numbers) with increase/decrease buttons vanishes when the respondent clicks on "Next" to getting to the next question page AND then clicks on "Previous" to get to the previous page of the survey. For example if the respondent decide to change his answers from a previous page, the numerical input (the numbers) with increase/decrease buttons are disappeared.

Cheers kompetenzz

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
5 Monate 2 Wochen her - 5 Monate 2 Wochen her #179054 von DenisChenu
??? Can you send me the template + a simple lss file ?

I take a quick look

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .
Letzte Änderung: 5 Monate 2 Wochen her von DenisChenu.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha