Have survey submittable after a certain date?

More
2 years 4 months ago #146798 by Darren
I want to have a survey be accessible, but not submittable, until a certain date. Is this possible?

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
2 years 4 months ago #146800 by tpartner
As far as I know, not possible.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #146805 by Darren
Darn, thanks for the response!

I was half hoping that someone would at least have some sort of convoluted javascript solution :)

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #146828 by Deusdeorum
So you want people to be able to fill the survey but not submit it? If yes, you can disable the submit until date is passed with some alert about that you cannot submit yet, with JS, if this is the case I can provide it for you later.

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #146838 by Darren

Deusdeorum wrote: So you want people to be able to fill the survey but not submit it? If yes, you can disable the submit until date is passed with some alert about that you cannot submit yet, with JS, if this is the case I can provide it for you later.


That would work perfectly, thank you!

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #146852 by DenisChenu
I think of another solution, without javascript

Short text question type / hidden (or not if you ask something at end).
Validation equation at : date("YMD")>"20170601"

No js included / no way to submit with hack.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago - 2 years 4 months ago #146872 by Darren
This isn't working, I'm still able to submit the survey:



What am I doing wrong?
Last edit: 2 years 4 months ago by Darren.

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #146873 by DenisChenu
The question CAN not be hidden ... sorry : you must use hidden in CSS class, not the 'hide this question' attribute.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #146882 by Deusdeorum
DenisChenu´s answer is probably a better approach but here's a javascript solution that disables button on click with an alert.
<script type="text/javascript" charset="utf-8">
  $(document).ready(function() {
 
      var date_now = new Date();
      var sub_date = new Date("2017-1-10");
 
      if (date_now < sub_date) {
          $('#movesubmitbtn').click(function() {
              $(this).prop('disabled', true);
              alert("You cannot submit this survey until" + sub_date);
          });
      }
  });
</script>

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #146884 by Darren
Once I figured out that the question should be on the last page, and not the first, it's working splendidly. Since there's no question to add the "This question is mandatory" warning, the popup might be a little confusing. I could add a text Q at the bottom stating that attempting to submit prior to X date will result in an error.

Semi-related, is it possible to perform "date math"...specifically, something like {EXPIRY-3} (which would show the date 3 days prior to the survey's expiration)?

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago - 2 years 4 months ago #146885 by Darren
sorry for the duplicate post, didn't realize I couldn't delete my own
MOD: feel free to delete, thanks!
Last edit: 2 years 4 months ago by Darren.

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #146886 by Darren

Deusdeorum wrote: DenisChenu´s answer is probably a better approach but here's a javascript solution that disables button on click with an alert.

<script type="text/javascript" charset="utf-8">
  $(document).ready(function() {
 
      var date_now = new Date();
      var sub_date = new Date("2017-1-10");
 
      if (date_now < sub_date) {
          $('#movesubmitbtn').click(function() {
              $(this).prop('disabled', true);
              alert("You cannot submit this survey until" + sub_date);
          });
      }
  });
</script>


That's awesome, thanks! I combined it with {EXPIRY} and a little date math so now it won't be submittable until X days before expiration.

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #146887 by Darren

Darren wrote: Once I figured out that the question should be on the last page, and not the first, it's working splendidly. Since there's no question to add the "This question is mandatory" warning, the popup might be a little confusing. I could add a text Q at the bottom stating that attempting to submit prior to X date will result in an error.

Semi-related, is it possible to perform "date math"...specifically, something like {EXPIRY-3} (which would show the date 3 days prior to the survey's expiration)?


Quoting myself because I realize I wasn't clear on this - I'd like to use date math on the relevance equation. This way I can have a "warning" message at the bottom when the survey is unsubmittable, and direct the user to click "Resume later". Thanks again!

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #146894 by Deusdeorum

Darren wrote:

Deusdeorum wrote: DenisChenu´s answer is probably a better approach but here's a javascript solution that disables button on click with an alert.

<script type="text/javascript" charset="utf-8">
  $(document).ready(function() {
 
      var date_now = new Date();
      var sub_date = new Date("2017-1-10");
 
      if (date_now < sub_date) {
          $('#movesubmitbtn').click(function() {
              $(this).prop('disabled', true);
              alert("You cannot submit this survey until" + sub_date);
          });
      }
  });
</script>


That's awesome, thanks! I combined it with {EXPIRY} and a little date math so now it won't be submittable until X days before expiration.


Please carefully test this before using it in production because I haven't.

Please Log in or Create an account to join the conversation.

More
2 years 4 months ago #146932 by Darren

Deusdeorum wrote:
Please carefully test this before using it in production because I haven't.

So far the only problem I've found is that it doesn't seem to work on mobile (iPad/iPhone). It seems to bypass the JS and gives the standard "One or more questions have not been answered in a valid manner. You cannot proceed until these answers are valid." I've search the forum for javascript on mobile, but haven't found anything other than a question of whether JS can be disabled completely. Is there a trick that I'm missing?

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!