- Posts: 9
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Multiple choice with comments
- benmok
- Topic Author
- Offline
- New Member
Less
More
10 years 10 months ago #96214
by benmok
Multiple choice with comments was created by benmok
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
Also is there a way to make the comment box mandatory?
Thanks in advance.
Ben
Attachments:
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
10 years 10 months ago #96225
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Multiple choice with comments
You have to play with javascript.
Somethink like that:
For second question: www.limesurvey.org/en/forum/design-issue...quired-comment#96222
Denis
Somethink like that:
Not tested or validated, please adapt.$("#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();
}
});
For second question: www.limesurvey.org/en/forum/design-issue...quired-comment#96222
Denis
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- benmok
- Topic Author
- Offline
- New Member
Less
More
- Posts: 9
- Thank you received: 0
10 years 10 months ago #96263
by benmok
Replied by benmok on topic Multiple choice with comments
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
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 topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13935
- Thank you received: 2551
10 years 10 months ago #96268
by DenisChenu
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Multiple choice with comments
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
Give the idea and the principle.
Xhat error do you have ? Can you provide link to test and screenshot of "Expression manager validation" ?
Denis
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.