Welcome to the LimeSurvey Community Forum

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

How to create a question with the option to add another line?

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 6 months ago #126539 by tpartner
The only way I see to do that would be to insert following long-text questions and then use JavaScript to move those textareas into the array cells. I don't have time to code that but you may find similar examples in the forum.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DOwen
  • DOwen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
8 years 6 months ago #126562 by DOwen
Not sure I'll be able to move anything around with JS myself but ill take a look around and see if I can find anything that might help.

Would it be possible to drop Additional Information (ie, the third and last array field) onto a second row underneath? I also have another question to create which has 5 array fields instead of 3 so it would be good to display these over 2 or more rows...
The topic has been locked.
More
8 years 6 months ago #126571 by first
I guess you can consider professional help from Professional parterres :)

www.limesurvey.com/survey-creation

Survey Designer and Programmer
The topic has been locked.
  • DOwen
  • DOwen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
8 years 6 months ago #126573 by DOwen
It would be a shame to have to pay anyone as we've managed to achieve a lot so far thanks to help from the forum and self-teaching!
The topic has been locked.
  • DOwen
  • DOwen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
8 years 6 months ago - 8 years 6 months ago #126577 by DOwen
Just to expand on this, I have been asked to try and build a question(s) that work as follows...

We would like the user to add items, in a similar fashion as above, by selecting an item from a drop down list, but then once the product is selected, a list of about 25 questions (different questions per product type) will appear asking finer details on that particular product. I'm envisioning achieving this via a normal dropdown question with a condition set to show all relevant 25 questions underneath when a particular product type is selected.

It would be great to have the same 'Add Another Product' button working on a group of questions.

The problem with this however is adding additional products. I'm struggling to think of a solution. Can anyone please help or advise?
Last edit: 8 years 6 months ago by DOwen.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 6 months ago #126583 by holch
I think with 25 different questions the normal (+) approach doesn't make sense.

I would create a group for each product including all 25 questions and then at the end I would include a question that asks if they want to add another product. The next question group will only be shown if this question has been answered with yes.

You will need a new page anyway, in my opinion. If there are so many different questions per product.

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

The following user(s) said Thank You: DOwen
The topic has been locked.
  • DOwen
  • DOwen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
8 years 6 months ago #126586 by DOwen
Thanks holch, I think that sounds ideal. So perhaps the first question would be displayed on its own asking if a product needs to be added, if yes, a product type dropdown question appears, then depending on what was selected, a list of 25 questions will appear. Once completed and the Next button is pressed, a duplicated question group (with a different ID) will appear and ask the questions again.

Would this work? Not sure how I can tell the survey to display a certain question group on the next page based on conditions though?
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 6 months ago - 8 years 6 months ago #126591 by holch
You can use a relevance equation for the whole group of questions.

Let's assume that the question that defines if there will be a next question or not has the code G1add (so it is the last question of the a group of question, let's call it "G1" that contains all the information of the first product).

Then the relevance equation (not tested) should look something like that, if "yes" is code 1 and "no" any other code.
Code:
G1add=='1'

This means that the next question group will only be shown if in question G1add "Yes" was answered. If you do this with the groups for the following products (G2add, G3add), etc. they will only be shown if in the previous group of question the last question about adding another product was answered with yes.

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

Last edit: 8 years 6 months ago by holch.
The following user(s) said Thank You: DOwen
The topic has been locked.
  • DOwen
  • DOwen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
8 years 6 months ago #126601 by DOwen
Awesome thanks for this! Will try it out and let you know how I get on.

Also had a thought, I was wondering if perhaps the question type 'Multiple Short Text' would work better instead of the Array question type as this could accommodate more fields better and possibly be easier to adjust the size of the text fields...
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 6 months ago #126602 by holch
Ajusting the size of the text fields doesn't help much, I think. Because you could always make them bigger via CSS, but the limit of the field (and in the database) will still persist.

It doesn't help to have a huge test field and at the end you can only enter a few characters. If you post the 25 questions for each product, maybe we can come up with what makes sense and what not.

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

The topic has been locked.
  • DOwen
  • DOwen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
8 years 6 months ago #126659 by DOwen
Thanks holch! Will report back soon.
The topic has been locked.
  • DOwen
  • DOwen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
8 years 6 months ago #126666 by DOwen

holch wrote: Ajusting the size of the text fields doesn't help much, I think. Because you could always make them bigger via CSS, but the limit of the field (and in the database) will still persist.

It doesn't help to have a huge test field and at the end you can only enter a few characters. If you post the 25 questions for each product, maybe we can come up with what makes sense and what not.


OK either my logic is not functioning correctly or I'm making a mistake, but I can't get this to work. I can't seem to get the next quesiton group to display once 'Add ANOTHER item' is answered Yes...

Here's the survey: Click here
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose