Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Multiple choice with comments

Multiple choice with comments 1 Jahr 3 Monate her #96214

  • benmok
  • benmoks Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 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
Anhang:
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Multiple choice with comments 1 Jahr 3 Monate her #96225

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6276
  • Dank erhalten: 801
  • Karma: 240
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
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Multiple choice with comments 1 Jahr 3 Monate her #96263

  • benmok
  • benmoks Avatar
  • OFFLINE
  • Fresh Lemon
  • Beiträge: 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
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Multiple choice with comments 1 Jahr 3 Monate her #96268

  • DenisChenu
  • DenisChenus Avatar
  • OFFLINE
  • Moderator Lime
  • Beiträge: 6276
  • Dank erhalten: 801
  • Karma: 240
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
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.187 Sekunden
Donation Image