Welcome to the LimeSurvey Community Forum

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

Howto save incomplete data from questiontype multiple short text

  • SurveyDennis
  • SurveyDennis's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 6 months ago #158882 by SurveyDennis
I have a survey with just one question - multiple short text with 10 options to fill in.
Data is only saved ofcourse when you click next or finish.
But I also want to save the options when somebody didn't clicked on next or finish.

Not sure if this would be the correct approach but I was thinking the following:
Create another hidden question before the real multiple short question and save the answers there as well.

Or can I do something with Relevance equation?

Be SurveyFriendly too! Fight against boring surveys! www.SurveyFriendly.com
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 years 6 months ago - 6 years 6 months ago #158898 by tpartner
I'm on vacation, working from phone, so can't offer any substantial code but I think you would need to put a listener on the keyup/change/paste events of the inputs that makes an AJAX call to a remote PHP script to update the database directly.

Or maybe the RPC update_response() method - api.limesurvey.org/classes/remotecontrol...thod_update_response

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 6 years 6 months ago by tpartner.
The following user(s) said Thank You: SurveyDennis
The topic has been locked.
  • SurveyDennis
  • SurveyDennis's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 6 months ago #158913 by SurveyDennis
Have a nice vacation Tony!!!

Thanks for pushing me in the right direction.
For now I have made a small workaround to save the data with php write to a file (when somethings changes in the input).

Be SurveyFriendly too! Fight against boring surveys! www.SurveyFriendly.com
The topic has been locked.
  • SurveyDennis
  • SurveyDennis's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
6 years 6 months ago - 6 years 6 months ago #158922 by SurveyDennis
Just sharing -

If you need to do the same as what I have tried you can do the following:
When the input changes from the open text it will also change the answer option from another question.


Code:
<script>
$(document).ready(function(){
    $("#answer896439X312X1365A1").change(function(){
    var inputls = document.getElementById("answer896439X312X1365A1");
        $( 'input#answer896439X313X1374A1' ).val(inputls);
    });
}); 
</script>

In my case I also need to do this for incomplete data but that is not working.
The example code above is just more if you want to autopunch another question.

Be SurveyFriendly too! Fight against boring surveys! www.SurveyFriendly.com
Last edit: 6 years 6 months ago by SurveyDennis.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose