- Posts: 21
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
Please Log in to join the conversation.
// 4rd column conditional on 3nd column if($(this).closest('.answer-item').hasClass('answer_cell_SQ003')) { handleColumnSQ004($(this)); } }); function handleColumnSQ004(thisSelect) { var thisRow = $(thisSelect).closest('tr.subquestion-list'); var item4 = $('.answer_cell_SQ004', thisRow); if($(thisSelect).val() == '4') { $('input:text', item4).prop('disabled', false); } else { $('input:text', item4).val('').prop('disabled', true); $('input:text', item4).val('').trigger('change'); } }
// Listener on column 6 inputs $('.answer-item.answer_cell_SQ006 input:text', thisQuestion).on('keyup change', function(e) { var thisValue = $.trim($(this).val()); // Numerics only if($.isNumeric(thisValue) === false) { // Strip out non-numerics characters newValue = thisValue.replace(/\D/g,''); $(this).val(newValue).trigger('change'); }
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ var thisQuestion = $('#question{QID}'); // Add a question class thisQuestion.addClass('custom-array'); // Column-specific classes $('table.subquestion-list tr', thisQuestion).each(function(i) { $('th, td', this).each(function(i) { $(this).addClass('column-'+i); }); }); }); </script> <style type="text/css">.custom-array table.subquestion-list col { width: auto !important; } .custom-array table.subquestion-list thead .column-0 { width: 4%; } .custom-array table.subquestion-list thead .column-1 { width: 20%; } .custom-array table.subquestion-list thead .column-2 { width: 20%; } .custom-array table.subquestion-list thead .column-3 { width: 10%; } .custom-array table.subquestion-list thead .column-4 { width: 20%; } .custom-array table.subquestion-list thead .column-5 { width: 17%; } .custom-array table.subquestion-list thead .column-6 { width: 9%; } </style>
Please Log in to join the conversation.
Please Log in to join the conversation.