buttons to increase/deacrease numerical input (spinners)

Plus d'informations
il y a 1 mois 2 semaines #177576 par KompetenzZ
KompetenzZ a créé le sujet : buttons to increase/deacrease numerical input (spinners)
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
Pièces jointes :

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 2 semaines - il y a 1 mois 2 semaines #177588 par DenisChenu
DenisChenu a répondu au sujet : buttons to increase/deacrease numerical input (spinners)
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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Dernière édition: il y a 1 mois 2 semaines par DenisChenu.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 2 semaines #177663 par KompetenzZ
KompetenzZ a répondu au sujet : buttons to increase/deacrease numerical input (spinners)
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

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 2 semaines #177667 par tpartner
tpartner a répondu au sujet : buttons to increase/deacrease numerical input (spinners)
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.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 2 semaines - il y a 1 mois 2 semaines #177669 par DenisChenu
DenisChenu a répondu au sujet : buttons to increase/deacrease numerical input (spinners)

tpartner écrit: 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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Dernière édition: il y a 1 mois 2 semaines par DenisChenu. Raison: complete dir name

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 2 semaines #177677 par KompetenzZ
KompetenzZ a répondu au sujet : buttons to increase/deacrease numerical input (spinners)
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.

Fichier attaché :

Nom du fichier : extends1_b...2-02.zip
Taille du ficher :190 ko

Cheers kompetenzz
Pièces jointes :

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 2 semaines - il y a 1 mois 2 semaines #177700 par DenisChenu
DenisChenu a répondu au sujet : buttons to increase/deacrease numerical input (spinners)
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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Pièces jointes :
Dernière édition: il y a 1 mois 2 semaines par DenisChenu.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 2 semaines - il y a 1 mois 2 semaines #177713 par KompetenzZ
KompetenzZ a répondu au sujet : buttons to increase/deacrease numerical input (spinners)
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
Dernière édition: il y a 1 mois 2 semaines par KompetenzZ.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 2 semaines - il y a 1 mois 2 semaines #177715 par KompetenzZ
KompetenzZ a répondu au sujet : buttons to increase/deacrease numerical input (spinners)
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
Pièces jointes :
Dernière édition: il y a 1 mois 2 semaines par KompetenzZ.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 2 semaines - il y a 1 mois 2 semaines #177728 par DenisChenu
DenisChenu a répondu au sujet : buttons to increase/deacrease numerical input (spinners)
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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Dernière édition: il y a 1 mois 2 semaines par DenisChenu.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 2 semaines #177729 par DenisChenu
DenisChenu a répondu au sujet : buttons to increase/deacrease numerical input (spinners)
OK,

A fixed template with the script inside custom.js

Fichier attaché :

Nom du fichier : extends1_b...fix2.zip
Taille du ficher :191 ko


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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Pièces jointes :

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 1 semaine - il y a 1 mois 1 semaine #177827 par KompetenzZ
KompetenzZ a répondu au sujet : buttons to increase/deacrease numerical input (spinners)
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
Dernière édition: il y a 1 mois 1 semaine par KompetenzZ.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 mois 1 semaine #177841 par DenisChenu
DenisChenu a répondu au sujet : buttons to increase/deacrease numerical input (spinners)

KompetenzZ écrit: 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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 semaine 18 heures #179048 par KompetenzZ
KompetenzZ a répondu au sujet : buttons to increase/deacrease numerical input (spinners)
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

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 1 semaine 14 heures - il y a 1 semaine 14 heures #179054 par DenisChenu
DenisChenu a répondu au sujet : buttons to increase/deacrease numerical input (spinners)
??? 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 (or search sondages pro).
An error happen ? Before make a new topic : remind the Debug mode .
Dernière édition: il y a 1 semaine 14 heures par DenisChenu.

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!