- Posts: 64
- Karma: 2
- Thank you received: 10
Check and uncheck with code
- SurveyDennis
-
Topic Author
- Offline
- Senior Lime
-
Less
More
4 years 11 months ago #105756
by SurveyDennis
Be SurveyFriendly too
dennis [at] SurveyFriendly [dot] com
Check and uncheck with code was created by SurveyDennis
Hi,
I am using an image and depended on the areas selected on that image I would like to get the answer 'punched'.
All working with some old code, however not anymore.
I probably only have a setting wrong in the coding.
Checking is working however unchecking not.
Maybe somebody spots it already:
In the demo below only the left image is working and then only the areas in the head.
survey
Many thanks, dennis
I am using an image and depended on the areas selected on that image I would like to get the answer 'punched'.
All working with some old code, however not anymore.
I probably only have a setting wrong in the coding.
Checking is working however unchecking not.
Maybe somebody spots it already:
if (alt === 'head') {
if ( $('#answer313628X20X42A1').attr('checked') == true){
$('#answer313628X20X42A1').attr('checked',false);
}
else {
$('#answer313628X20X42A1').attr('checked',true);
}
}
In the demo below only the left image is working and then only the areas in the head.
survey
Many thanks, dennis
Be SurveyFriendly too
dennis [at] SurveyFriendly [dot] com
Please Log in or Create an account to join the conversation.
- SurveyDennis
-
Topic Author
- Offline
- Senior Lime
-
Less
More
- Posts: 64
- Karma: 2
- Thank you received: 10
4 years 11 months ago - 4 years 11 months ago #105768
by SurveyDennis
Be SurveyFriendly too
dennis [at] SurveyFriendly [dot] com
Replied by SurveyDennis on topic Check and uncheck with code
this post can be closed, sorry for asking I found the solution in the meantime.
it worked with the .prop
it worked with the .prop
if ($('#answer313628X20X42A1').is(':checked')) {
$( '#answer313628X20X42A1' ).prop( "checked", false );
}
else {
$( '#answer313628X20X42A1' ).prop( "checked", true );
}
Be SurveyFriendly too
dennis [at] SurveyFriendly [dot] com
Last edit: 4 years 11 months ago by SurveyDennis.
Please Log in or Create an account to join the conversation.
4 years 11 months ago #105777
by Ben_V
Benoît
EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Replied by Ben_V on topic Check and uncheck with code
Hi Dennis,
I'm glad that your "body image map" question is now working fine.
It would be very nice if you can provide an export and/or hints, because it will be very useful for other users using limesurvey for rheumatology assessment or research.
Ben.
I'm glad that your "body image map" question is now working fine.
It would be very nice if you can provide an export and/or hints, because it will be very useful for other users using limesurvey for rheumatology assessment or research.
Ben.
Benoît
EM Variables => bit.ly/1TKQyNu | EM Roadmap => bit.ly/1UTrOB4
Last Releases => 2.6x.x goo.gl/ztWfIV | 2.06/2.6.x => bit.ly/1Qv44A1
Demo Surveys => goo.gl/HuR6Xe (already included in /docs/demosurveys)
Please Log in or Create an account to join the conversation.
- SurveyDennis
-
Topic Author
- Offline
- Senior Lime
-
Less
More
- Posts: 64
- Karma: 2
- Thank you received: 10
4 years 11 months ago #105778
by SurveyDennis
Be SurveyFriendly too
dennis [at] SurveyFriendly [dot] com
Replied by SurveyDennis on topic Check and uncheck with code
Hi Ben,
Yes for sure, I make sure to document this in the weekend and share it here!
Dennis
Yes for sure, I make sure to document this in the weekend and share it here!
Dennis
Be SurveyFriendly too
dennis [at] SurveyFriendly [dot] com
The following user(s) said Thank You: Ben_V
Please Log in or Create an account to join the conversation.
- SurveyDennis
-
Topic Author
- Offline
- Senior Lime
-
Less
More
- Posts: 64
- Karma: 2
- Thank you received: 10
4 years 11 months ago #105783
by SurveyDennis
Be SurveyFriendly too
dennis [at] SurveyFriendly [dot] com
Replied by SurveyDennis on topic Check and uncheck with code
I have added some documentation about this on my site - feel free to copy and paste it.
Howto define areas on image and use them as answers:
Quick howto
Demo:
Demo
Howto define areas on image and use them as answers:
Quick howto
Demo:
Demo
Be SurveyFriendly too
dennis [at] SurveyFriendly [dot] com
Please Log in or Create an account to join the conversation.