Check out the LimeSurvey source code on GitHub!

Minimum characters in Input

More
3 years 8 months ago #96670 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

Please Log in to join the conversation.

More
3 years 8 months ago #96680 by tpartner
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 following user(s) said Thank You: jnvalcarcel

Please Log in to join the conversation.

More
9 months 2 weeks ago #135859 by mana
HI TONY,

Don't work
i want to set Minimum characters on Multiple numerical input for phone number

Please Log in to join the conversation.

More
9 months 2 weeks ago - 9 months 2 weeks ago #135895 by tpartner
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: 9 months 2 weeks ago by tpartner.

Please Log in to join the conversation.

More
9 months 2 weeks ago #135902 by delarammahdaviii
sorry
yes it's work . :blush: :S
sorry again

Please Log in to join the conversation.

More
8 months 1 week ago #137884 by jnvalcarcel
It works just fine. :) grettings from PerĂº

Please Log in to join the conversation.

More
4 months 6 days ago #143353 by Szipola
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!

Please Log in to join the conversation.

More
4 months 6 days ago #143355 by Joffm
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:

Please Log in to join the conversation.

More
4 months 6 days ago #143361 by Szipola
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

Please Log in to join the conversation.

More
4 months 6 days ago #143363 by Joffm
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:

Please Log in to join the conversation.

More
4 months 6 days ago #143366 by Szipola
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!

Please Log in to join the conversation.

More
4 months 6 days ago - 4 months 6 days ago #143370 by Joffm
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: 4 months 6 days ago by Joffm. Reason: Typo

Please Log in to join the conversation.

More
4 months 6 days ago #143371 by tpartner

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 following user(s) said Thank You: holch

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form