Welcome to the LimeSurvey Community Forum

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

HTML tag sets numeric fields as text.

More
5 years 9 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.
More
5 years 9 months ago #191482 by tpartner
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.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose