Welcome to the LimeSurvey Community Forum

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

Question is hidden but blank screen appears?

  • nadica123
  • nadica123's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 months 2 weeks ago #267653 by nadica123
Limesurvey version: 6.3.4
Own server

Hello,

I've found this code on this forum, which is quite useful for me as it saves the date and time of when a question has been answered.

<script>
  $(document).ready(function(){
if($('#question{QID} input:text:eq(0)').val() == '') {
      $('#question{QID} input:text:eq(0)').val(new Date());
    }
      {
     $('#question{QID}').hide();
  }
  });
</script>

There is the line of code which is supposed to hide the question, but what happens is I get a blank screen instead of the question being skipped. I tried using the 'Always hide this question' feature which indeed skips the question, but that way I don't get the date and time saved in the variable.

My question is, is there a way in which I don't get a blank screen, but the date and time is captured of when a certain question is answered?

Thank you.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 months 2 weeks ago #267656 by Joffm
Hi,
I suppose, you don't get a blank screen, but a screen with only the navigation buttons.
Of course, first the entire page is displayed.
Then, after everything is loaded (  $(document).ready(function(){ you hide the question. But the rest remains.

Solutions:
1. You have to display "group by group" and have this question in a group with other questions you display.
2. If you only want to enter a date and time in a text question you may use the default value like {date("m-d-Y H:i:s")}. or whatever format you prefer
This question you may hide by "Always hide this question"

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose