- Posts: 4
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
While giving survey, Clicking on Submit, doesnt refresh page immediately
- patecj
- Topic Author
- Offline
- New Member
Less
More
5 years 7 months ago #172319
by patecj
While giving survey, Clicking on Submit, doesnt refresh page immediately was created by patecj
I have created one survey which is for closed group and has only one question.
While giving survey by user, user gives answer and clicks submit but page takes a while to refresh page. This delay make user confused and they click twice/thrice on submit thinking their response has not submitted and end up seeing page where they need to enter token.
How can I disable submit on submit or how can I show progress bar to indicate user that page is loading?
While giving survey by user, user gives answer and clicks submit but page takes a while to refresh page. This delay make user confused and they click twice/thrice on submit thinking their response has not submitted and end up seeing page where they need to enter token.
How can I disable submit on submit or how can I show progress bar to indicate user that page is loading?
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
5 years 7 months ago - 5 years 7 months ago #172322
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic While giving survey, Clicking on Submit, doesnt refresh page immediately
Assuming you are using a current LimeSurvey version, you can add this script to the source of a question on the last page. It will display a modal spinner when the "Submit" button is clicked.
Code:
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ $('body').append('<div class="modal fade spinner-modal" data-backdrop="static" data-keyboard="false" tabindex="-1">\ <div class="modal-dialog modal-sm">\ <div class="modal-content" style="width: 100px; padding: 10px 0; text-align:center;">\ <span class="fa fa-spinner fa-spin fa-3x" style="font-size: 6em;"></span>\ </div>\ </div>\ </div>'); $('#ls-button-submit').on('click', function(e) { $('.spinner-modal').modal('show'); }); }); </script>
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 5 years 7 months ago by tpartner.
The topic has been locked.
- patecj
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
5 years 7 months ago #172340
by patecj
Replied by patecj on topic While giving survey, Clicking on Submit, doesnt refresh page immediately
This looks good and works.
Only issue is, I have to do this manually in last question for all surveys.
Also, this spinner image doesn't go off even after submitting Survey. Hence, script display Thank you page but with spinner.
Is there any permanent solution which I can apply on code itself?
Only issue is, I have to do this manually in last question for all surveys.
Also, this spinner image doesn't go off even after submitting Survey. Hence, script display Thank you page but with spinner.
Is there any permanent solution which I can apply on code itself?
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5070
- Thank you received: 1263
5 years 7 months ago #172342
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic While giving survey, Clicking on Submit, doesnt refresh page immediately
What LimeSurvey version is used?
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- patecj
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
5 years 7 months ago #172343
by patecj
Replied by patecj on topic While giving survey, Clicking on Submit, doesnt refresh page immediately
LimeSurvey
Version 3.13.2+180709
Version 3.13.2+180709
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
5 years 7 months ago - 5 years 7 months ago #172405
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic While giving survey, Clicking on Submit, doesnt refresh page immediately
If you want the spinner on the final question page of every survey using a specific template, add this to the template custom.js file.Only issue is, I have to do this manually in last question for all surveys.
Code:
$(document).on('ready pjax:scriptcomplete',function(){ if($('.ls-move-submit-btn').length > 0 && !$('.ls-move-submit-btn').hasClass('ls-move-next-btn')) { $('body').append('<div class="modal fade spinner-modal" data-backdrop="static" data-keyboard="false" tabindex="-1">\ <div class="modal-dialog modal-sm">\ <div class="modal-content" style="width: 100px; padding: 10px 0; text-align:center;">\ <span class="fa fa-spinner fa-spin fa-3x" style="font-size: 6em;"></span>\ </div>\ </div>\ </div>'); $('.ls-move-submit-btn').on('click', function(e) { $('.spinner-modal').modal('show'); }); } });
Sorry, I don't know what you are trying to say.Also, this spinner image doesn't go off even after submitting Survey. Hence, script display Thank you page but with spinner.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 5 years 7 months ago by tpartner.
The topic has been locked.
- patecj
- Topic Author
- Offline
- New Member
Less
More
- Posts: 4
- Thank you received: 0
5 years 7 months ago #172420
by patecj
Replied by patecj on topic While giving survey, Clicking on Submit, doesnt refresh page immediately
"Also, this spinner image doesn't go off even after submitting Survey. Hence, script display Thank you page but with spinner."
When I clicked submit survey, it takes user to Thank you text message but spinner still is on.
When I clicked submit survey, it takes user to Thank you text message but spinner still is on.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10611
- Thank you received: 3690
5 years 7 months ago #172430
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic While giving survey, Clicking on Submit, doesnt refresh page immediately
That's not what I found in testing. Please provide a short test survey.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.