- Posts: 31
- 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() { // Define some variables var thisQuestion = $('#question'+qID); var q1Value = '{q1.shown}'; var q2Value = '{q2.shown}'; var sumValue = Number(q1Value) + Number(q2Value); // Load the question $('input[type="text"]', thisQuestion).val(sumValue); // Hide this question $(thisQuestion).hide(); }); </script>
<script type="text/javascript" charset="utf-8"> $(document).ready(function() { var q1Value = {q1.shown}; var q2Value = {q2.shown}; var sumValue = Number(q1Value) + Number(q2Value); $(".numeric:eq(0) input.text").val(sumValue) // Hide + autosubmit // $('.numeric).hide(); // document.limesurvey.submit(); }); </script>