- Posts: 419
- Thank you received: 34
Ask the community, share ideas, and connect with other LimeSurvey users!
<td style="background-color: {if(Status=="Yes", "#C5E0B3",if(Status=="Maybe","#FFFF99","#FF908A"))}; text-align: center;">
<td style="background-color: #<span id='LEMtailor_Q_13539_2'>FF908A</span>; text-align: center;">
<td style="background-color: {ColorCode}; text-align: center;">
#<span id='LEMtailor_Q_13539_2'>FF908A</span>
<table border="0" cellpadding="1" cellspacing="1" style="width:100%;"> <tbody> <tr> <td id="notice" style="background-color: red; text-align: center;"> <p> </p> <p> </p> <h1><strong>{if(Q62=="G","Contact is FIT for Travel",if(Q62=="Y","Additional Information Required","Contact is UNFIT for Travel"))}</strong></h1> <p> </p> </td> </tr> </tbody> </table> <script type="text/javascript"> var colr = {Q62}; if(colr = "G") { document.getElementById('notice').style.backgroundColor= '#00FF00'; }; </script>
var colr = [b]<span id='LEMtailor_Q_13539_6'></span>[/b]; if(colr = "G") { document.getElementById('notice').style.backgroundColor= '#00FF00'; };
<script type="text/javascript" data-author="Tony Partner"> $(document).on('ready pjax:scriptcomplete',function(){ // Listener on the radios $('#question{QID} :radio').on('click', function(e) { // Reset the class names $('#notice').removeClass('bg-success bg-warning bg-danger'); // Assign a class name to the #notice element if($(this).val() == 'G') { $('#notice').addClass('bg-success'); } else if($(this).val() == 'Y') { $('#notice').addClass('bg-warning'); } else { $('#notice').addClass('bg-danger'); } }); }); </script>