Minimum characters in Input

More
4 years 5 months ago #96670 by creativologist
creativologist created the topic: Minimum characters in Input
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
4 years 5 months ago #96680 by tpartner
tpartner replied the topic: Minimum characters in Input
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
1 year 6 months ago #135859 by mana
mana replied the topic: Minimum characters in Input
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
1 year 6 months ago - 1 year 6 months ago #135895 by tpartner
tpartner replied the 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: 1 year 6 months ago by tpartner.

Please Log in to join the conversation.

More
1 year 6 months ago #135902 by delarammahdaviii
delarammahdaviii replied the topic: Minimum characters in Input
sorry
yes it's work . :blush: :S
sorry again

Please Log in to join the conversation.

More
1 year 5 months ago #137884 by jnvalcarcel
jnvalcarcel replied the topic: Minimum characters in Input
It works just fine. :) grettings from Perú

Please Log in to join the conversation.

More
1 year 1 month ago #143353 by Szipola
Szipola replied the 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!

Please Log in to join the conversation.

More
1 year 1 month ago #143355 by Joffm
Joffm replied the 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
Attachments:

Please Log in to join the conversation.

More
1 year 1 month ago #143361 by Szipola
Szipola replied the 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

Please Log in to join the conversation.

More
1 year 1 month ago #143363 by Joffm
Joffm replied the 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
Attachments:

Please Log in to join the conversation.

More
1 year 1 month ago #143366 by Szipola
Szipola replied the 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!

Please Log in to join the conversation.

More
1 year 1 month ago - 1 year 1 month ago #143370 by Joffm
Joffm replied the topic: Minimum characters in Input
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 year 1 month ago by Joffm. Reason: Typo

Please Log in to join the conversation.

More
1 year 1 month ago #143371 by tpartner
tpartner replied the topic: Minimum characters in Input

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.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!