Results 1 to 3 of 3

Thread: Change Color when check box is ticked?

  1. #1
    Join Date
    May 2013
    Posts
    6

    Default Change Color when check box is ticked?

    I have a questionnaire created and it contains some check boxes. I would like the checkbox and text to change color when ticked. Any idea how to accomplish this?

  2. #2
    Join Date
    May 2013
    Posts
    6

    Default Re: Change Color when check box is ticked?

    I added this

    'customCode' => '{$fields.interest_c.value}',

    But all i get is a 1 or a 0 in red. Not the Check box.

    Name:  checkbox.PNG
Views: 364
Size:  5.8 KB

    I would like the Label Asthma to go red when ticked.

  3. #3
    Join Date
    May 2013
    Posts
    6

    Default Re: Change Color when check box is ticked?

    I cant get this to work. I have been reading a bit and it seems jquery might be the best way to get this to work. Here is what I have done so far but still cant get it to work.

    I added the following to detailviewdefs.php
    'includes' => array (
    0 => array ( 'file' => 'custom/modules/Leads/js/checkbox.js',),
    1 => array ( 'file' => 'modules/Leads/Lead.js' ,),

    In custom/modules/Leads/js I created a files called checkbox.js with the following

    $(function(){
    $( "input[type=checkbox]" ).on( "click", function(){
    if($(this).is(':checked'))
    $(this).parent().css('background-color', '#cd0000');
    else
    $(this).parent().css('background-color', '#FFF');
    });
    });

    Can someone try explain to me what I am doing wrong??

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Change Text Color
    By kdmp in forum Help
    Replies: 4
    Last Post: 2013-05-27, 03:24 PM
  2. Change color in the listview
    By nanduruchi in forum Developer Help
    Replies: 3
    Last Post: 2010-11-13, 07:09 PM
  3. how I can change font and color?
    By MahsaN in forum Developer Help
    Replies: 1
    Last Post: 2010-08-09, 12:09 PM
  4. Replies: 0
    Last Post: 2008-08-09, 10:18 PM
  5. Change some row color
    By portega in forum Help
    Replies: 5
    Last Post: 2008-05-15, 12:09 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •