Awesome!!! Thanks a lot!
Could you send me you BTC or BTS account?
Added the expression like this [!is_empty(Q2a_comment) or (Q2a.NAOK == "1") or (Q2a.NAOK == "2")]
It looks well.
Final style like this: the mandatory comment shows when chosen NAOK3 or NAOK4, while the comment will auto hided and non-mandatory when chosen NAOK1 or NAOK2.
//When I use "!is_empty(Q2a_comment)", it worked.
//However it's failed when expression is [if((Q2a.NAOK == "3" or Q2a.NAOK == "4"),!is_empty(Q2a_comment),"")]
//I want the mandatory comment shows when chosen NAOK3 or NAOK4, while the comment will auto hided and non-mandatory when chosen //NAOK1 or NAOK2.
//Hereafter is the auto hided code:
Code:
<script type="text/javascript" charset="utf-8">
$(document).ready(function(){
// Identify this question
var thisQuestion = $('#question{QID}');
// start listener
$('input.radio', thisQuestion).on('click', function(e) {
if($(this).attr('value') >2 ) {
$('p.answer-item',thisQuestion).show();
}
else {
$('p.answer-item',thisQuestion).hide();
}
});
});
</script>
.