Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

skip several groups of questions in javascript

  • sociotlse
  • sociotlse's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 8 months ago #241199 by sociotlse
Hi
I'm trying to skip several groups of questions in Javascript when the user presses "next", depending on the answers the user has given. 

I manage to stop the submit with a "return false;". I can't manage to redirect to a particular LimeSurvey page. Is there a solution?

Thank you in advance !

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 8 months ago #241203 by Joffm
Hi,
is there a special reason to use JavaScript?
Usually this is done by "relevance equation", now called "condition".

Joffm 

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • sociotlse
  • sociotlse's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
1 year 8 months ago #241208 by sociotlse
Replied by sociotlse on topic skip several groups of questions in javascript
Hi
And thank you for your answer.
Yes, unfortunately. Determining the number of groups to skip does not depend on simple answers but on calculations from answers, which can only be done in javascript. Except if there is a possibility that a condition takes as input the object of a calculation by the javascript performed?

Thank you by advance

Please Log in to join the conversation.

  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 8 months ago #241215 by holch
If you can't calculate it with an expression/equation (which I doubt, because you can calculate a lot of things in an equation question via expression manager, but let's assume this is the case), why not writing the calculation into a equation question and then use conditions based on this equation question?

Afaik there is no way to skip questions based on Javascript.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 8 months ago #241224 by tpartner
Replied by tpartner on topic skip several groups of questions in javascript
You cannot write to an equation question with JavaScript but you can write to a hidden (via CSS) text or radio question.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 8 months ago #241235 by Joffm

Determining the number of groups to skip does not depend on simple answers but on calculations from answers, which can only be done in javascript.

Please, show it and we will do our very best to solve your problem.

As @holch and @tpartner already said: You can do the calculation in a question of type "short text" which you then use as condition
And in your script you may use ExpressionScript variables.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose