Welcome to the LimeSurvey Community Forum

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

Minimum characters in Input

  • creativologist
  • creativologist's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
10 years 10 months ago #96670 by creativologist
Minimum characters in Input was created by creativologist
I see in the advanced settings of question for Input you can set MAXIMUM Characters. That's great, but what about MINIMUM Characters?

If I have long free text, I'd like to get meaningful responses - meaning more than a certain number of characters. For example, "your answer is too short" if someone types just the word "Yes" or any too short of a response that isn't very helpful to us.

Can that be done somewhere?

thanks
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
10 years 10 months ago #96680 by tpartner
Replied by tpartner on topic Minimum characters in Input
Try adding something like this to the "Question validation equation" field:
Code:
strlen(this) > 100

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: jnvalcarcel
The topic has been locked.
More
7 years 11 months ago #135859 by mana
Replied by mana on topic Minimum characters in Input
HI TONY,

Don't work
i want to set Minimum characters on Multiple numerical input for phone number
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 11 months ago - 7 years 11 months ago #135895 by tpartner
Replied by tpartner on topic Minimum characters in Input
I find that quite an abrupt and incorrect statement! It DOES work for long text questions!

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 7 years 11 months ago by tpartner.
The topic has been locked.
  • delarammahdaviii
  • delarammahdaviii's Avatar
  • Offline
  • Senior Member
  • Senior Member
More
7 years 11 months ago #135902 by delarammahdaviii
Replied by delarammahdaviii on topic Minimum characters in Input
sorry
yes it's work . :blush: :S
sorry again
The topic has been locked.
More
7 years 10 months ago #137884 by jnvalcarcel
Replied by jnvalcarcel on topic Minimum characters in Input
It works just fine. :) grettings from Perú
The topic has been locked.
More
7 years 5 months ago #143353 by Szipola
Replied by Szipola on topic Minimum characters in Input
If I have short free text, I'd like to it's allowed only numbers and only min and max seven digit. But it is important to allow this format: 000001 or 0023517 and etc.. So sometimes a digit sequenceI starting with one or more zero. I tried to use this regex: /^[0-9]{7}$/, but it isn't allowed digit sequence starting with one or more zero.

So, how can I write this?

I hope my question is understandable. I have used English really long time ago.

Thanks!
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 5 months ago #143355 by Joffm
Replied by Joffm on topic Minimum characters in Input
Hi, Szipola,
remove the "only numbers" from advanced settings.
Your regular expression validates the "numbers only".

And this works for me: (see screenshots)

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
7 years 5 months ago #143361 by Szipola
Replied by Szipola on topic Minimum characters in Input
Hi, Joffm,

But I'd like to can write in text field this set of digits: "0000125" or 0000001, too. Not just this: 1204586
In this formation I can't do that.

Best regards
Szipola
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 5 months ago #143363 by Joffm
Replied by Joffm on topic Minimum characters in Input
Hi, Szipola,
as you saw in the second screenshot I entered "0001234".

Again.
Just select question type "short text"
Enter in "Validation": /^[0-9]{7}$/

See screenshots:
1. Entering Value
2. Result shown on next page.

Regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
7 years 5 months ago #143366 by Szipola
Replied by Szipola on topic Minimum characters in Input
Ohhh! Sorry! I see. Just the "danger text (red one)" not turns to green color. But I can step the next page. Thanks! But why not turn on another color? Because this is misleading, a little.

I have another question.
If I've five question and I'd like to one can write different asnwers for every question. So if one write "13" in the first question, one can't write this number in the next or in the last question.
How can I do this?

Thanks!
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 5 months ago - 7 years 5 months ago #143370 by Joffm
Replied by Joffm on topic Minimum characters in Input
Hi, Szipola,
regarding the message:
You can change the color by entering this in the question text:
Code:
<style type="text/css">.questionvalidcontainer .text-danger {
    color: #eeee41;  //Or whatever color you want
}
</style>

You can hide the message by entering this in the question text:
Code:
<style type="text/css">.questionvalidcontainer .text-danger {
   display:none;
</style>

Best regards
Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 7 years 5 months ago by Joffm. Reason: Typo
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose