- Posts: 31
- Thank you received: 4
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Identify the questions var q1 = $('#question'+{QID}+''); var q2 = $(q1).nextAll('.list-dropdown:eq(0)'); var alertText = 'The two dropdowns cannot have the same answer.'; // On submit, compare the 2 dropdown values $('#movenextbtn, #movesubmitbtn').click(function(){ if($('.answer-item select', q1).val() != '' && $('.answer-item select', q1).val() == $('.answer-item select', q2).val()) { alert(alertText); return false; } }); }); </script>