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?

  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
9 years 1 month ago #126307 by Mazi

DOwen wrote: I've tried this with array questions to test it (as well as other question types) but cannot get it to work. Whether I put the scipt inside the .JS file or the question/group description :(

Since the JavaScript code depends on the HTML structure and thus on the template, that is probably the reason this is not working.

Please post a link to an activated test survey so we can have a look. It may be easy to fix if it is just a typo or a different class name within the HTML structure but if the template structure is completely different, you may need some professional help to adjust everything (feel free to ping me at marcel.minke@limesurvey.org).

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
  • DOwen
  • DOwen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 1 month ago - 9 years 1 month ago #126308 by DOwen
Hi thanks for your reply!

Here's a link to the activated test survey: Test Survey

I have moved the Array question to the beginning, ignore the rest of the survey. It seems that even the plus and minus buttons are no longer appearing now.

Thank you!
Last edit: 9 years 1 month ago by DOwen.
The topic has been locked.
  • tammo
  • tammo's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
9 years 1 month ago #126309 by tammo
huddle.rockit.com/index.php/224571?lang=en

Not Found

The requested URL /index.php/224571 was not found on this server.

Did you activate the survey?

Tammo


Tammo ter Hark at Respondage
For Limesurvey reporting, education and customized themes
respondage.nl
The topic has been locked.
  • DOwen
  • DOwen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 1 month ago - 9 years 1 month ago #126310 by DOwen
Sorry guys! Our server is internally accessible only. I've contacted the IT administrator to make it public, will let you know when its accessible.

Also, the plus and minus buttons mysteriously appeared. However they do not bring up new array text fields.

Thanks!
Last edit: 9 years 1 month ago by DOwen.
The topic has been locked.
  • DOwen
  • DOwen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 1 month ago #126343 by DOwen
Hi guys,

The survey should now be public so you can check it out. (May take 10 mins as of this email)

Link here

Thanks!
The topic has been locked.
More
9 years 1 month ago #126348 by Ben_V
Another more basic approach is the use of a multiple-opt (not mandatory) question with just one option "Add another product" with the related checkbox (check/uncheck)
Remember that you can style this question with CSS and/or javascript
Try-it, pasting the following code in the help area of the question....
Code:
<script type="text/javascript">
    $(document).ready(function() {
            $( "<style type='text/css'>"
            + "#question{QID} { border:none; font-size:120%}"
            +"</style>").appendTo( "head" );
    });
</script>

Benoît

EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
9 years 1 month ago #126354 by Mazi

DOwen wrote: The survey should now be public so you can check it out. (May take 10 mins as of this email)

Though there are no JavaScript errors the structure of your survey HTML seems to differ so the JavaScript can't access the needed elements.

Check the JS and compare the elements it deals with step by step. I assume due to different HTML elements the script doesn't trigger the correct elements.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 1 month ago #126366 by holch
Tpartners solutions are usually based on the default template I think, so any other template might not work directly out of the box and would need to be adapted.

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: tpartner
The topic has been locked.
  • DOwen
  • DOwen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 1 month ago #126453 by DOwen
Hey Ben, thanks for this!

However just tried it out but can't seem to get it working; no '+' symbols are showing...
The topic has been locked.
  • DOwen
  • DOwen's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
9 years 1 month ago #126455 by DOwen

Mazi wrote:

DOwen wrote: The survey should now be public so you can check it out. (May take 10 mins as of this email)

Though there are no JavaScript errors the structure of your survey HTML seems to differ so the JavaScript can't access the needed elements.

Check the JS and compare the elements it deals with step by step. I assume due to different HTML elements the script doesn't trigger the correct elements.


Just tried to see if I could pick out any issues with the HTML vs the JS, but struggling. Javascript is not my best skill unfortunately!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
9 years 1 month ago #126458 by tpartner
DOwen, the linked survey is not accessible. Can you please attach a sample exported .lss file containing only your array question and the associated JavaScript and an exported zip of your template?

I am just returning from vacation so won't have a lot of free time for the next few days but I'll try to have a quick look.

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
9 years 1 month ago #126459 by DOwen
Hi tpartner, thanks for this!

I had just temporarily taken down the survey but its back up again now. The questions haven't been edited much, just want to make sure the functionality we need works first.

I appreciate you taking time to take a look, thanks!
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose