Welcome, Guest
Username: Password: Remember me

TOPIC: Conditional after long free text?

Conditional after long free text? 1 year 6 months ago #93033

  • sD960
  • sD960's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 45
  • Thank you received: 1
  • Karma: 0
Hello-

I'd like a (non-text) question to appear after a mandatory long free text question, contingent on the survey-taker entering anything at all in the long free text box. (The survey-takers are non-anonymous adults who can be trusted to write something meaningful.) I'm assuming I use regular expressions for this. I've made the second question conditional on /^[-\w]+(?:\W+[-\w]+){0,299}\W*$/ for the first question, but all that happens is Limesurvey thinks the survey ends with the long free text question--that is, the SUBMIT button shows up rather than the NEXT button below the long free text question.

I've no idea what I'm doing wrong. And, for the record, I've never (knowingly) dealt with a regular expression before in my whole life--so please don't be too cryptic in your explanation!

We're using 2.00, Build 121213, and will upgrade in the future but not now. Can't risk changing anything at this point.

Thanks!
The administrator has disabled public write access.

Conditional after long free text? 1 year 6 months ago #93070

  • sD960
  • sD960's Avatar
  • OFFLINE
  • Senior Lime
  • Posts: 45
  • Thank you received: 1
  • Karma: 0
Solved it! There's a "SPECIAL NOTE: Regular Expressions in conditions" in the manual that says "Note that when using regular expressions in the condition editor, do NOT include the beginning and ending slash."

I replaced /^[-\w]+(?:\W+[-\w]+){0,299}\W*$/ with ^[-\w]+(?:\W+[-\w]+){0,299}\W*$ and it works fine. The second question appears as soon as anything is typed into the first long free text question. I assume if I wanted the second question to not appear until after at least several words have been typed into the text box, I'd simply change the 0 in {0,299} to some positive number approximating the number of characters in a short sentence.

So, no response needed unless there's something I missed. Hope this is helpful to someone else!
The administrator has disabled public write access.
The following user(s) said Thank You: holch

Conditional after long free text? 1 year 6 months ago #93072

  • holch
  • holch's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 2675
  • Thank you received: 323
  • Karma: 121
Thank you for posting your solution. I might help others with a similar problem.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.097 seconds
Donation Image