- Posts: 4
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Text box questions
- Structure
- Topic Author
- Offline
- New Member
Less
More
10 months 4 days 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?
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
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13052
- Thank you received: 4018
10 months 4 days ago #244999
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
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
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
10 months 3 days 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!
Thank you!
Attachments:
Please Log in to join the conversation.
- holch
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 11710
- Thank you received: 2756
10 months 3 days ago #245033
by holch
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
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.
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
10 months 3 days ago #245037
by Structure
Replied by Structure on topic Text box questions
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13052
- Thank you received: 4018
10 months 2 days ago #245043
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
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
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
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
10 months 2 days 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
Thank you
Structure
Please Log in to join the conversation.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13052
- Thank you received: 4018
9 months 4 weeks ago #245088
by Joffm
[url] manual.limesurvey.org/Question_type_-_Sh...28preg_validation.29 [/url]
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Text box questions
Did you read the manual about question types?i'm just wondering where I would need to import those lines of code in the question to make them work.
[url] manual.limesurvey.org/Question_type_-_Sh...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.