Welcome, Guest
Username: Password:

TOPIC: Change color of chosen answer....

Change color of chosen answer.... 2 years 4 months ago #102843

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 5761
  • Thank you received: 1251
  • Karma: 512
Hi David,

There is no way to select a parent of an element with CSS.

You will need to modify all of the listeners in imagetick_lime.js to add a class to the parent <li> element when a radio or checkbox is checked. Something like:
$('#tick_img_'+id).closest('li').addClass('checkedItem');

And then in template.css, something like this:
li.checkedItem {
	color:red;
}
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The administrator has disabled public write access.

Change color of chosen answer.... 2 years 4 months ago #102849

  • dweisser
  • dweisser's Avatar
  • Offline
  • Gold Lime
  • Posts: 222
  • Thank you received: 5
  • Karma: 5
I'll give it a shot. Thank you!
The administrator has disabled public write access.

Change color of chosen answer.... 2 years 4 months ago #102854

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 8718
  • Thank you received: 1214
  • Karma: 360
:checked like this can be used only with css.

Here you need JS.

Denis
The administrator has disabled public write access.

Change color of chosen answer.... 2 years 4 months ago #102866

  • dweisser
  • dweisser's Avatar
  • Offline
  • Gold Lime
  • Posts: 222
  • Thank you received: 5
  • Karma: 5
Thanks again guys,

I accomplished this by adding:

$('#tick_img_'+id).closest('li').addClass('uncheckedItem');
$('#tick_img_'+id).closest('li').removeClass('checkedItem');

and

$('#tick_img_'+id).closest('li').addClass('checkedItem');
$('#tick_img_'+id).closest('li').removeClass('uncheckedItem');

As you suggested. I hope it helps someone.
David
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.208 seconds