Welcome to the LimeSurvey Community Forum

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

HTML tag sets numeric fields as text.

  • jueves
  • jueves's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 5 months ago #191439 by jueves
I'm not sure if this is a feature or a bug, but when I create a numeric only input question, Limesurvey adds the tag type="text" to the input block, which on mobile has the inconvinience of opening the text keyboard instead of the numeric keyboard.

Example:
Code:
<!-- Answer -->
<div class=" answer-container    col-xs-12" >
        <!-- Numerical -->
 
<!-- answer -->
<div class='ls-answers answer-item text-item numeric-item '>
 
    <!-- Prefix -->
 
 
            <input id="answer85469X2X11" class="form-control numeric" title="Only numbers may be entered in this field." maxlength="20" data-number="1" data-integer="0" aria-labelledby="ls-question-text-85469X2X11" type="text" value="" name="85469X2X11" />
    <!-- Suffix -->
 
 
</div>
 
<!-- end of answer -->

Any idea of how could I solve it?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #191482 by tpartner
Replied by tpartner on topic HTML tag sets numeric fields as text.
The input type is intentional to accommodate different decimal and thousands separators.

You could work around it by creating a custom question theme or, if you want it more globally, copy the numeric question twig files into your survey theme and modify those.

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: DenisChenu, jueves
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose