Check out the LimeSurvey source code on GitHub!

Problem with numeric array type question

More
3 years 6 months ago #97221 by mattias01
I would like to validate this type of question, for example the number selected in row 1 can not select the same in row two


Attachment answer.png not found



<script type="text/javascript">
 
var preguntaI_1 = '#answer588446X306X2976P16_1_1';
var preguntaI_2 = '#answer588446X306X2976P16_2_1';
 
 
  $(document).ready(function() {
        $(preguntaI_2).change(function() {
            if ($(this).val() == $(preguntaI_1).val()) {
                alert('equal');
            } else {
                alert('diferent');
            }
        });
    });
 
</script>
 


regards
Attachments:

Please Log in to join the conversation.

More
3 years 6 months ago #97304 by DenisChenu
Hello,

Maybe something like this with EM directly:
(QQ_SQ1_SQ1!=QQ_SQ1_SQ2 and QQ_SQ1_SQ1!=QQ_SQ1_SQ3 and QQ_SQ1_SQ1!=QQ_SQ1_SQ4 .... )
and
(QQ_SQ2_SQ1!=QQ_SQ2_SQ2 and QQ_SQ2_SQ1!=QQ_SQ2_SQ3 and QQ_SQ2_SQ1!=QQ_SQ2_SQ4 .... )
and
..

Look at :
Sub-question validation equation (em_validation_sq)
And
Expression Manager (maybe you can use some function, like countif ?)

Denis

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand (or search sondages pro).

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form