Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

TOPIC: Minimum characters in Input

Minimum characters in Input 3 years 6 months ago #96670

  • creativologist
  • creativologist's Avatar
  • Offline
  • Junior Lime
  • Posts: 25
  • Thank you received: 1
  • Karma: 0
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 administrator has disabled public write access.

Minimum characters in Input 3 years 6 months ago #96680

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6570
  • Thank you received: 1477
  • Karma: 579
Try adding something like this to the "Question validation equation" field:
strlen(this) > 100
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.
The following user(s) said Thank You: jnvalcarcel

Minimum characters in Input 6 months 3 weeks ago #135859

  • mana
  • mana's Avatar
  • Offline
  • Junior Lime
  • Posts: 24
  • Karma: 0
HI TONY,

Don't work
i want to set Minimum characters on Multiple numerical input for phone number
The administrator has disabled public write access.

Minimum characters in Input 6 months 3 weeks ago #135895

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6570
  • Thank you received: 1477
  • Karma: 579
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: 6 months 3 weeks ago by tpartner.
The administrator has disabled public write access.

Minimum characters in Input 6 months 3 weeks ago #135902

sorry
yes it's work . :blush: :S
sorry again
The administrator has disabled public write access.

Minimum characters in Input 5 months 2 weeks ago #137884

It works just fine. :) grettings from PerĂº
The administrator has disabled public write access.

Minimum characters in Input 1 month 2 weeks ago #143353

  • Szipola
  • Szipola's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
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 administrator has disabled public write access.

Minimum characters in Input 1 month 2 weeks ago #143355

  • Joffm
  • Joffm's Avatar
  • Offline
  • Platinum Lime
  • Posts: 461
  • Thank you received: 127
  • Karma: 24
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
Attachments:
The administrator has disabled public write access.

Minimum characters in Input 1 month 2 weeks ago #143361

  • Szipola
  • Szipola's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
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 administrator has disabled public write access.

Minimum characters in Input 1 month 2 weeks ago #143363

  • Joffm
  • Joffm's Avatar
  • Offline
  • Platinum Lime
  • Posts: 461
  • Thank you received: 127
  • Karma: 24
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
Attachments:
The administrator has disabled public write access.

Minimum characters in Input 1 month 2 weeks ago #143366

  • Szipola
  • Szipola's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 3
  • Karma: 0
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 administrator has disabled public write access.

Minimum characters in Input 1 month 2 weeks ago #143370

  • Joffm
  • Joffm's Avatar
  • Offline
  • Platinum Lime
  • Posts: 461
  • Thank you received: 127
  • Karma: 24
Hi, Szipola,
regarding the message:
You can change the color by entering this in the question text:
<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:
<style type="text/css">.questionvalidcontainer .text-danger {
   display:none;
</style>

Best regards
Joffm
Last Edit: 1 month 2 weeks ago by Joffm. Reason: Typo
The administrator has disabled public write access.

Minimum characters in Input 1 month 2 weeks ago #143371

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6570
  • Thank you received: 1477
  • Karma: 579
I see. Just the "danger text (red one)" not turns to green color. But I can step the next page.
That sounds like a bug, please file a bug report.


If I've five question and I'd like to one can write different asnwers for every question.
Place something like this in the Question validation equation field for all questions (adjusting the question codes as necessary):
unique(Q1, Q2, Q3, Q4, Q5)

And something like this in the Question validation tip fields:
{if(unique(Q1, Q2, Q3, Q4, Q5), '', 'Answers must be unique.')}
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.
The following user(s) said Thank You: holch
Time to create page: 0.391 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form