Welcome to the LimeSurvey Community Forum

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

Text box questions

  • Structure
  • Structure's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 3 months ago #244998 by Structure
Text box questions was created by Structure
Please help us help you and fill where relevant:
Your LimeSurvey version: [ LimeSurvey Community Edition
Version 5.6.30+230711]
Own server or LimeSurvey hosting: LimeSurvey hosting
Survey theme/template:
==================
(Write here your question/remark)
   

Hello, I have 2 questions regarding text boxes. In q1 I want the text box to only take numerical responses but I also want the numbers to show on the left side of the field if someone types a response. Is there any possible way to do that? In q2 I want to be able to again only accept numerical responses but also have the dashes. Is there a way to set this up? 

 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 3 months ago #244999 by Joffm
Replied by Joffm on topic Text box questions
Hi, 
1. easy way is to use regular expressions
a. /^\d+$/
 


b. /^([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))$/
 



2. Use an inputmask.
Either Robin Herbots' "inputmask" 
[url] github.com/RobinHerbots/Inputmask [/url]
 
or Igor Escobar's "jquery mask"
[url] igorescobar.github.io/jQuery-Mask-Plugin/ [/url]
 

After you decided what you prefer, please send a lss export of yout survey (only these relevant questions).

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: Structure

Please Log in to join the conversation.

  • Structure
  • Structure's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 3 months ago #245031 by Structure
Replied by Structure on topic Text box questions
Hello, thank you so much for your reply here I have provided lsq's files for this question. 

Thank you!

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 3 months ago #245033 by holch
Replied by holch on topic Text box questions
Noone wants LSQ files. Please always provide LSS files.

Why? LSQ and LSG files are language sensitive. So not only do we have to create a new survey and at least 1 new question group to import these files, we also have to "guess" the base language correctly.

In addition, for some solutions it is important to understand the general settings used in the survey, which are only visible in the LSS file.

So help us to help you and provide us with a LSS file. And no, we are not interested in your whole survey, but only the relevant bits. So make a copy of your survey, delete everything that is not relevant and export it as a LSS file.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Please Log in to join the conversation.

  • Structure
  • Structure's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 3 months ago #245037 by Structure
Replied by Structure on topic Text box questions
 

File Attachment:

File Name: lemonlime.lss
File Size:45 KB

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 3 months ago #245043 by Joffm
Replied by Joffm on topic Text box questions
Hi,
these are only three empty questions.
You neither entered the regular expressions (or adapted ones) I showed nor did you try to insert on of the input masks.
At least you could have entered the shown regular expressions adapted to your needs.

So what do you expect us to do?
Which of the three proposed options do you want to use?
RegExp is the easiest.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • Structure
  • Structure's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 3 months ago #245054 by Structure
Replied by Structure on topic Text box questions
Hello I apologize, I sent the blank questions because I'm new to lime survey i'm just wondering where I would need to import those lines of code in the question to make them work. 

Thank you 
Structure 

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 3 months ago #245088 by Joffm
Replied by Joffm on topic Text box questions

i'm just wondering where I would need to import those lines of code in the question to make them work. 

Did you read the manual about question types?
[url] www.limesurvey.org/manual/Question_type_...28preg_validation.29 [/url]

 

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose