- Posts: 3
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { // Interrupt the Next/Submit function $('#movenextbtn, #movesubmitbtn').click(function(e){ if($('.multiple-opt:visible input.checkbox:checked').length > 2) { alert('You can only select up to 2 items.'); return false; } }); }); </script>
You try it Denis - it's buggy as hell!This don't work with EM ? Whole question validation (for each or only one (the first for example).
count(self,that.question2,that.question3) < 3
Give it a try
Yes, good point.To avoid this you can add a blank div or span somewhere in the template
<script charset="utf-8" type="text/javascript"> $(document).ready(function() { $( '#question{QID} .question-item:eq(0)').addClass('hide-pseudo-elements').find('input.checkbox').remove(); $( '#question{QID} .question-item:eq(4)').addClass('hide-pseudo-elements').find('input.checkbox').remove(); $( '#question{QID} .question-item:eq(7)').addClass('hide-pseudo-elements').find('input.checkbox').remove(); }); </script>
<style type="text/css">.hide-pseudo-elements label::before, .hide-pseudo-elements label::after { display: none; } .hide-pseudo-elements .label-text { margin-left: -20px; } </style>
<span style="font-size:12pt;background-color:#CCC;font-weight:bold;border: 1px solid #888;padding:2px">Part 1</span>