Welcome, Guest
Username: Password: Remember me

TOPIC: Multiple choice with comments

Multiple choice with comments 10 months 4 weeks ago #96214

  • benmok
  • benmok's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 10
  • Karma: 0
Hi - I am trying to make the comment box in a multiple choice with comment question only appear for those that the respondents have selected.

Also is there a way to make the comment box mandatory?

Thanks in advance.
Ben
Attachments:
The administrator has disabled public write access.

Multiple choice with comments 10 months 4 weeks ago #96225

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 5845
  • Thank you received: 715
  • Karma: 222
You have to play with javascript.

Somethink like that:
$("#question{QID} input.checkbox").click(function(){
if ($(this).prop('checked')){
$(this).closest(".answer-item").find(".comment").show();
}else{
$(this).closest(".answer-item").find(".comment").hide();
}
});
Not tested or validated, please adapt.

For second question: www.limesurvey.org/en/forum/design-issue...quired-comment#96222

Denis
The administrator has disabled public write access.

Multiple choice with comments 10 months 4 weeks ago #96263

  • benmok
  • benmok's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 10
  • Karma: 0
Hi Denis,

I have not been able to get the javascript to work. Are you able to help?
Actually i have no idea what in the script to change.

I have tried your QCODE_SQ1comment function for the validation script and it didn't work. I am not sure if i got the syntax correct or not. Sorry i know very little of java script and am in the deep water.
This is the syntax i used.
(!is_empty(Reason_1) and is_empty(Reason_1comment))

Thanks,
Ben
The administrator has disabled public write access.

Multiple choice with comments 10 months 4 weeks ago #96268

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 5845
  • Thank you received: 715
  • Karma: 222
I never test javascript and EM for forum.
Give the idea and the principle.

Xhat error do you have ? Can you provide link to test and screenshot of "Expression Manager validation" ?

Denis
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.120 seconds
Donation Image