Check out the LimeSurvey source code on GitHub!

condition 'not null' or 'not blank'

More
6 years 4 months ago - 6 years 4 months ago #49893 by jmenard
I'm hopping to set up a question that only appears if the previous short text question is 'not null' or 'not blank'.

I was hopping to setup the comparison operator equals 'not null' since my only criteria is to have an answer in the test field.

Can this be done?
Last Edit: 6 years 4 months ago by jmenard.

Please Log in to join the conversation.

More
6 years 4 months ago #49894 by jmenard
I was able to answer my own question.

I'm using the following regular expressions:


Word count

The following restricts the number of words allowed to a minimum of 1 and a maximum of 200
/^[-\w]+(?:\W+[-\w]+){0,199}\W*$/


TX

Please Log in to join the conversation.

More
6 years 4 months ago #50529 by jmenard
Oups I was wrong.

So It dose not work... Bad testing. It was hiding the question in all conditions.


Anyone???

Please Log in to join the conversation.

More
6 years 4 months ago #50535 by mdekker
www.unix.com/shell-programming-scripting...ular-expression.html

Did you read that? they talk about 'not empty' regular expressions. Try some and report back what worked for you or add it to the manual.

The minumum width in the manual looks promising to me... did you try that?
/^.{1,}$/

At least one char is needed this way.

---
Menno Dekker

Please Log in to join the conversation.

More
6 years 4 months ago #50563 by Mazi
Isn't it possible to set a constant value for comparison? Something like ""?


Best regards/Beste Grüße,
Dr. Marcel Minke
(Limesurvey Head of Support)
Need Help? We offer professional Limesurvey support
Contact: marcel.minke(at)survey-consulting.com'"

Please Log in to join the conversation.

More
5 years 8 months ago - 5 years 8 months ago #61890 by waitz
I am struggling with this one....

I need to create a rule that makes the recipient see:
-Question 1 if token x is blank
-Question 2 if token x is not blank

I tried to see what happened when I added /^.{1,}$/ as a regular expression, but it did not have any affect at all. I searched in the documentation, but it didn't make me wiser.

Anyone know how I can use reg.exp to the 2 scenarios above?

Version 1.91+ Build 11232 | PHP 5.3.9 | MySQL 5.1.56 |
Last Edit: 5 years 8 months ago by waitz.

Please Log in to join the conversation.

More
5 years 8 months ago #61968 by waitz

Mazi wrote: Isn't it possible to set a constant value for comparison? Something like ""?

It took a while before I understood what you meant. By setting 'equal to' or 'not equal to', choose constant and not entering anything, the condition is understood as 'No answer'

Great!

Version 1.91+ Build 11232 | PHP 5.3.9 | MySQL 5.1.56 |

Please Log in to join the conversation.

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