Welcome to the LimeSurvey Community Forum

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

Numerical Input Form Question.

  • pvb8008
  • pvb8008's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 3 months ago #145448 by pvb8008
Numerical Input Form Question. was created by pvb8008
I noticed that the Numerical Input question type is coded as <input type="text" when I look at the source code on Limesurvey. In HTML5 it should be coded as <input type="number". This is important when filling out a form on a mobile device as the keyboard automatically defaults to a number keyboard not letters. This spares the user from having to use the shift key to pull up the number keyboard.

How and where can the code be edited so the all Numerical Input question types are presented as <input type="number" ?

Thanks,

Peter
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 months ago #145450 by tpartner
Replied by tpartner on topic Numerical Input Form Question.
I think it is set to type="text" to allow for comma as decimal separator. Some Android devices don't have a comma in the numeric keypad.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • pvb8008
  • pvb8008's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 3 months ago #145452 by pvb8008
Replied by pvb8008 on topic Numerical Input Form Question.
Tony,

Noted. Two follow up questions.

1) Does the application allow editing of this or is it baked into the core program?

I am relatively new to LimeSurvey or at least version 2.56.1, so I don't know if such modifications can be done or are even recommended.

2) I have been using the Numerical Input question type as the most logical one for a question that requires a number for an answer where using a dropdown or preset range would be limiting. In your opinion is this the best choice for such a question?

Thank you for your reply!

Peter
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 months ago #145467 by DenisChenu
Replied by DenisChenu on topic Numerical Input Form Question.
Hi,

Yes : i think it's better to have type='number' for numeric item. Always ...
Like type='date' for date.

BUT : if we set it to 'number' : we break a lot of existing installation .... because of radix testing (comma as decimal separator).

I already use a javascript solution for this : if radix=="." then set numeric item to type='number'. ,Maybe it can be great to have it in a plugin/

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 topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 months ago #145538 by Joffm
Replied by Joffm on topic Numerical Input Form Question.
Hi,

but PLEASE do not change this to type="number" as long as Firefox displays it with this silly spinner.

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 months ago #145544 by DenisChenu
Replied by DenisChenu on topic Numerical Input Form Question.
I like the spinner ;)

But more : if i do it, i do it with a plugin, enable only if radix is '.' :).
Think if LS core have it : it's a 'option' or a new question type.

Denis

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 topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose