Welcome to the LimeSurvey Community Forum

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

How to put a submit button on every Question

  • maxrandolph
  • maxrandolph's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 7 months ago #141726 by maxrandolph
Hello,

I've been trying various ways of adding a button at the bottom of every question that allows the user to submit and end the survey from any group page. Adding a {SUBMITBUTTON} to the question template gives me a button with a "Submit" label, but the button itself acts like a glitchy Next button.

I've been trying to make a workaround using javascript, but everything I've tried seems to have very glitchy success(seems to work at first then fails 50%-80% of the time).

Any ideas?

Thanks a ton.
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 7 months ago #141732 by holch
As far as I know, it is only possible to "Submit" a survey on the end page.

However, actually any next button will save the survey done so far to the database.

What are you trying to do?

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.
  • maxrandolph
  • maxrandolph's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 7 months ago - 7 years 7 months ago #141736 by maxrandolph
Replied by maxrandolph on topic How to put a submit button on every Question
I see that the next button saves the answers but I was hoping for a button I could add to the end of each group page that would do this and also I guess put that token's associated usesleft to 0 so that a submission is final. The user could not then go back and alter answers.

After thinking about it for a bit and tinkering with javascript within a boilerplate question, I think maybe the best way to do this is have a button within a boilerplate that redirects to an external link that confirms submission and then updates the limesurvey database under the usesleft column.

I guess thinking about it now, that should work, but I guess I was curious of whether there was an internal way of doing this.

Also I've noticed that having an html <button> within a question seems to trigger an event that takes the user to the previous question page, regardless of content. Simply clicking a button with any time of onclick attribute seems to trigger this event.

EDIT:

Just realized this method would only work if I can trigger saving the current page's answers before redirecting to external link. Is there a way to trigger saving the survey answers via javascript?

Thanks.
Last edit: 7 years 7 months ago by maxrandolph. Reason: How to submit with js
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 7 months ago #141742 by tpartner
Replied by tpartner on topic How to put a submit button on every Question
A bit of a workaround...

Place a hidden radio question on every page (group) and have relevance on every subsequent group based on the hidden question being unchecked.

Use JavaScript to have the fake submit button first click the hidden radio and then the "Next" button. When that happens, all subsequent groups will be irrelevant so the respondent goes directly to the end.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • maxrandolph
  • maxrandolph's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 7 months ago #141769 by maxrandolph
Replied by maxrandolph on topic How to put a submit button on every Question
Perfect, thank you! Much appreciation. :)
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose