Welcome to the LimeSurvey Community Forum

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

Have survey submittable after a certain date?

  • Darren
  • Darren's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 months ago #146798 by Darren
I want to have a survey be accessible, but not submittable, until a certain date. Is this possible?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 months ago #146800 by tpartner
Replied by tpartner on topic Have survey submittable after a certain date?
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.
The topic has been locked.
  • Darren
  • Darren's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 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 :)
The topic has been locked.
More
7 years 2 months ago #146828 by Deusdeorum
Replied by Deusdeorum on topic Have survey submittable after a certain date?
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.
The topic has been locked.
  • Darren
  • Darren's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 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!
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 months ago #146852 by DenisChenu
Replied by DenisChenu on topic Have survey submittable after a certain date?
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 , plugin development .
I don't answer to private message.
The topic has been locked.
  • Darren
  • Darren's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 months ago - 7 years 2 months ago #146872 by Darren
This isn't working, I'm still able to submit the survey:



What am I doing wrong?
Last edit: 7 years 2 months ago by Darren.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 2 months ago #146873 by DenisChenu
Replied by DenisChenu on topic Have survey submittable after a certain date?
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 , plugin development .
I don't answer to private message.
The topic has been locked.
More
7 years 2 months ago #146882 by Deusdeorum
Replied by Deusdeorum on topic Have survey submittable after a certain date?
DenisChenu´s answer is probably a better approach but here's a javascript solution that disables button on click with an alert.
Code:
<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>
The topic has been locked.
  • Darren
  • Darren's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 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)?
The topic has been locked.
  • Darren
  • Darren's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 months ago - 7 years 2 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: 7 years 2 months ago by Darren.
The topic has been locked.
  • Darren
  • Darren's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 2 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.

Code:
<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.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose