- Posts: 136
- Thank you received: 37
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Workaround 'Making one (or more) rows of an array mandatory'
- steve_81
- Topic Author
- Offline
- Premium Member
Less
More
8 years 10 months ago #120614
by steve_81
Workaround 'Making one (or more) rows of an array mandatory' was created by steve_81
Hi guys,
I'm trying to use the workaround for making specific rows of a radio-matrix mandatory:
manual.limesurvey.org/Workarounds:_Manip...f_an_array_mandatory
Similar code found in the forum: www.limesurvey.org/de/forum/can-i-do-thi...-multiple-short-text
My problem is with this built-in disabling-navigation-buttons. I use this line:
like in the workaround but the buttons still getting disabled when my condition is false.
Minimal example of the code:
Version: 2.05+ Build 140821
Any suggestions, or is this workaround for another version?
Thanks
Stefan
I'm trying to use the workaround for making specific rows of a radio-matrix mandatory:
manual.limesurvey.org/Workarounds:_Manip...f_an_array_mandatory
Similar code found in the forum: www.limesurvey.org/de/forum/can-i-do-thi...-multiple-short-text
My problem is with this built-in disabling-navigation-buttons. I use this line:
Code:
$('#moveprevbtn, #movenextbtn, #movesubmitbtn').attr('disabled', '');
Minimal example of the code:
Code:
<script type="text/javascript" charset="utf-8"> // Wait until the document is fully loaded $(document).ready(function() { // Interrupt the submit function $('form#limesurvey').submit(function () { // Override the built-in "disable navigation buttons" feature $('#moveprevbtn, #movenextbtn, #movesubmitbtn').attr('disabled', ''); // The text to appear in the warning element var warningText = 'Exception: Eine oder mehrere Pflichtfragen sind nicht beantwortet worden. Bitte beantworten Sie diese zuerst, um fortzufahren!'; // The question ID var questionID = 858; //here comes a validation with a result SQall true or false. //... //... var SQall = false; if (SQall == false) { alert(warningText); return false; } else { return true; } }); }); </script>
Version: 2.05+ Build 140821
Any suggestions, or is this workaround for another version?
Thanks
Stefan
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
8 years 10 months ago - 8 years 10 months ago #120622
by DenisChenu
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.
Replied by DenisChenu on topic Workaround 'Making one (or more) rows of an array mandatory'
Hi,
Alternative solution of this old workaround : manual.limesurvey.org/Question_type_-_Ar...28em_validation_q.29
Example of usage (but not with array) : www.limesurvey.org/fr/forum/can-i-do-thi...lidation-help#120594
Denis
PS: manual.limesurvey.org/Expression_Manager...alidation_q_in_array and demonstration.sondages.pro/359222
Alternative solution of this old workaround : manual.limesurvey.org/Question_type_-_Ar...28em_validation_q.29
Example of usage (but not with array) : www.limesurvey.org/fr/forum/can-i-do-thi...lidation-help#120594
Denis
PS: manual.limesurvey.org/Expression_Manager...alidation_q_in_array and demonstration.sondages.pro/359222
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.
Last edit: 8 years 10 months ago by DenisChenu.
The following user(s) said Thank You: steve_81
The topic has been locked.
- steve_81
- Topic Author
- Offline
- Premium Member
Less
More
- Posts: 136
- Thank you received: 37
8 years 10 months ago #120648
by steve_81
Replied by steve_81 on topic Workaround 'Making one (or more) rows of an array mandatory'
Wow, perfect.
What a powerful thing validation is Works perfect and makes all my javascript unneccessary.
Merci beaucoup
Stefan
What a powerful thing validation is Works perfect and makes all my javascript unneccessary.
Merci beaucoup
Stefan
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13597
- Thank you received: 2487
8 years 10 months ago #120650
by DenisChenu
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.
Replied by DenisChenu on topic Workaround 'Making one (or more) rows of an array mandatory'
And you have double validation:
- client side with javascript
- server side with PHP
- client side with javascript
- server side with PHP
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.