- Posts: 4
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Disable survey if no javascript
- jsansonn
- Topic Author
- Offline
- New Member
Is there a way to prevent completion of a survey / disable a survey if javascript is disabled on the user's computer?
Thanks for your help, regards,
- tpartner
- Offline
- LimeSurvey Community Team
- Posts: 10611
- Thank you received: 3690
This in template.css:
#movenextbtn, #movesubmitbtn { display:none; }
And this in template.js:
$(document).ready(function() { $('#movenextbtn, #movesubmitbtn').show(); });
A more secure method would be to remove the {NAVIGATOR} placeholder from navigator.pstpl and insert the navigation buttons with JavaScript. Details of that script would vary by template and you would need to find a way to detect the last page so you could insert a "Submit" button instead of a "Next" button.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
- DenisChenu
- Offline
- LimeSurvey Community Team
- Posts: 13907
- Thank you received: 2546
Think,tpartner wrote: A more secure method would be to remove the {NAVIGATOR} placeholder from navigator.pstpl and insert the navigation buttons with JavaScript. Details of that script would vary by template and you would need to find a way to detect the last page so you could insert a "Submit" button instead of a "Next" button.
Maybe ,
<div id="navigatot-js"></div> <script> $(function() { var navigator="{htmlentities(NAVIGATOR)}"; $(navigator).appendTo("#navigatot-js"); }); </script>
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.
- tpartner
- Offline
- LimeSurvey Community Team
- Posts: 10611
- Thank you received: 3690
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
- holch
- Offline
- LimeSurvey Community Team
- Posts: 11746
- Thank you received: 2750
$(navigator).appendTo("#navigatot-js");
So "(navigator)" and not "(navigator}"?
If no, why not? (trying to update my JS skills...
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
- tpartner
- Offline
- LimeSurvey Community Team
- Posts: 10611
- Thank you received: 3690
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
- DenisChenu
- Offline
- LimeSurvey Community Team
- Posts: 13907
- Thank you received: 2546
You're rightholch wrote: So "(navigator)" and not "(navigator}"?
Did you try ? It work ?
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.
- holch
- Offline
- LimeSurvey Community Team
- Posts: 11746
- Thank you received: 2750
I just tried to understand what was done and saw that bracket which confused me.
I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.
- jelo
- Offline
- Platinum Member
- Posts: 5070
- Thank you received: 1263
Shouldn't Limesurvey prevent entering surveys with disabled javascript on client side out of the box?
Or demand enabling Javascript to carry on?
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
- tpartner
- Offline
- LimeSurvey Community Team
- Posts: 10611
- Thank you received: 3690
No, I don't think so. Most basic question types will work without JavaScript although Expression Manager functionality will be impaired. I have several clients who insist that their surveys be fully accessible, even without JavaScript.Shouldn't Limesurvey prevent entering surveys with disabled javascript on client side out of the box?
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
- jelo
- Offline
- Platinum Member
- Posts: 5070
- Thank you received: 1263
I would like to see a serverside only version of LS, but isn't LS 2.5 and LS 3.0 working without Javascript for respondents?tpartner wrote: No, I don't think so. Most basic question types will work without JavaScript although Expression Manager functionality will be impaired.
I am not sure the serverside checking is completely implemented. Wouldn't be surprised if more functionality has moved to the client.
I don't trust the client. Mobile devices haven't made it easier to convice me about moving code to the client.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
- DenisChenu
- Offline
- LimeSurvey Community Team
- Posts: 13907
- Thank you received: 2546
If it's not : this clearly a bug and must be fixed.jelo wrote: ....
I am not sure the serverside checking is completely implemented. ......
Actually , since a lot of uear : there are a miscontrol on single choice item (we don't control single choice item at server part : did the item exoist).
But in general : EM does the job client side + server side.
It can be easily tested with deactivating JS.
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.