- Posts: 11
- Thank you received: 0
Ask the community, share ideas, and connect with other LimeSurvey users!
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse:collapse;color:blue"> <tbody> <tr> <td style="text-align: left;" width="0%">Which ONE of the following is the BEST OPTION for you? </td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#D4D7E4" style="text-align: center;" width="15%"><br /><span style="font-size:12px;"><strong>Scenario 1</strong></span><br /> </td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#D4D7E4" style="text-align: center;" width="15%"><span style="font-size:12px;"><strong>Scenario 2</strong></span></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#D4D7E4" style="text-align: center;" width="15%"><span style="font-size:12px;"><strong>Scenario 3</strong></span></td> </tr> <tr style="height: 6px; text-align: center;"> </tr> <tr> <td bgcolor="#f2f2f2" style="text-align: left;"><span style="font-size:12px;">Range of services</span></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"> <div><span style="font-size:12px;">Full range</span></div> </td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:12px;">Broader but not comprehensive</span></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:12px;">Limited range of services</span></td> </tr> <tr style="height: 6px; text-align: center;"> </tr> <tr> <td bgcolor="#f2f2f2" style="text-align: left;"><span style="font-size:12px;">Time willing to wait for medication after general consultation</span></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:12px;">Medication to be given immediately</span></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:12px;">Collect after one day</span></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:12px;">Collect after a week</span></td> </tr> <tr style="height: 6px; text-align: center;"> </tr> <tr> <td bgcolor="#f2f2f2" style="text-align: left;"><span style="font-size:12px;">Subquestion 3</span></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:12px;">Option 1</span></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:12px;">Option 2</span></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:12px;">Option 3</span></td> </tr> <tr style="height: 6px; text-align: center;"> </tr> <tr> <td bgcolor="#f2f2f2" style="text-align: left;"><span style="font-size:12px;">Subquestion 4</span></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:12px;">Option 1</span></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:12px;">Option 2</span></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:12px;">Option 3</span></td> </tr> <tr style="height: 6px; text-align: center;"> </tr> <tr> <td bgcolor="#f2f2f2" style="text-align: left;"><span style="font-size:12px;">Subquestion 5</span></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:12px;">Option 1</span></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:12px;">Option 2</span></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:12px;">Option 3</span></td> </tr> <tr style="height: 6px; text-align: center;"> </tr> <tr> <td bgcolor="#f2f2f2" style="text-align: left;"><span style="font-size:12px;">Subquestion 6</span></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:12px;">Option 1</span></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:12px;">Option 2</span></td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"><span style="font-size:12px;">Option 3</span></td> </tr> <tr style="height: 6px; text-align: center;"> </tr> <tr> <td bgcolor="#f2f2f2" style="text-align: left;font-size:12px;font-weight:bold">Your choice </td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"> </td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2" style="text-align: center;"> </td> <td style="text-align: center;" width="0%"> </td> <td bgcolor="#f2f2f2"> </td> </tr> </tbody> </table>
<script type="text/javascript" charset="utf-8"> $(document).on('ready pjax:scriptcomplete',function(){ // Identify this question var thisQuestion = $('#question{QID}'); // Move the radios $('.question-text table:eq(0) tr:last td:eq(2)', thisQuestion).append($('.subquestion-list .answers-list:eq(0) .answer-item:eq(0) *', thisQuestion)); $('.question-text table:eq(0) tr:last td:eq(4)', thisQuestion).append($('.subquestion-list .answers-list:eq(0) .answer-item:eq(1) *', thisQuestion)); $('.question-text table:eq(0) tr:last td:eq(6)', thisQuestion).append($('.subquestion-list .answers-list:eq(0) .answer-item:eq(2) *', thisQuestion)); // Some classes for presentation $('.question-text table:eq(0) input:radio', thisQuestion).closest('td').addClass('answer-item radio-item text-center radio'); $('.question-text table:eq(0) .radio-item label', thisQuestion).show(); // Click event on the table cells $('.question-text table:eq(0) .radio-item', thisQuestion).on('click', function(e) { $('input:radio', this).trigger('click'); }); $('.question-text table:eq(0) input:radio', thisQuestion).on('click', function(e) { e.stopPropagation(); }); // Clean-up styles $('.answer-container', thisQuestion).hide(); $('.question-text table:eq(0) .label-text', thisQuestion).remove(); $('.question-text table:eq(0) .radio-text', thisQuestion).css({ 'cursor': 'pointer' }); }); </script>
Does your JavaScript get removed when you safe the question?liamcal wrote: In regards to my ability to use javascript, I am not sure. I can not locate "Configuration / Global Settings / Security" unfortunately.
<script type="text/javascript" charset="utf-8"> $(document).on('ready',function(){ alert('JavaScript works!'); }); </script>