Checkboxes invisible in Opera

ScorpiousDelectus 01 Oct, 2011
Hi guys, I'm in the process of doing browser compatibility tests with my new Joomla site and I've found that checkboxes within one of my forms aren't showing in Opera (v11). They are there as if you click where they are supposed to be, you get a tick but they're just not visible. No issues in Chrome, Firefox, IE & Safari.

See the checkboxes at http://newphase03.cloudaccess.net/contact-us.html in the Work For Us tab
GreyHead 01 Oct, 2011
Hi ScorpiousDelectus,

Hmm, Opera has elected to be purist and not provide a little default image for checkboxes.

You can alter the colour by adding this snippet in a Load CSS action
.ccms_form_element input[type='checkbox'] { 
  padding: 0 0 0 0 !important; 
  background-color: red; 
  border-color: transparent; 
  margin: 10px 5px 10px 5px; 
  clear: none; 
}


Unfortunately if you do this then the nice red boxes in Opera create messy red bleed throughs in IE. Using a Custom Code action with a little browser sniffing fixes this:
<?php
jimport('joomla.environment.browser'); 
$browser = JBrowser::getInstance(); 
if ( $browser->getBrowser() == 'opera' ) { 
  $style = "
.ccms_form_element input[type='checkbox'] { 
  padding: 0 0 0 0 !important; 
  background-color: red; 
  border-color: transparent; 
  margin: 10px 5px 10px 5px; 
  clear: none; 
}
  ";
  $doc = & JFactory::getDocument();
  $doc->addStyleDeclaration($style);
}
?>

Bob

PS You may not want them red though!
ScorpiousDelectus 01 Oct, 2011
Thanks for that. If I want the checkbox white, I can just have white in there instead of red?

Also, I'm not a coder so I wanted to clarify exactly where and in which file I am inserting this code?
GreyHead 02 Oct, 2011
Hi ScorpiousDelectus,

You can have any colour you like in there. I just used red so that it showed up in the standard Joomla! template. You might also want to add a border colour.

The code goes in a Custom Code action - drag one over from the actions list and move it before the Show HTML action in the On Load event.

Bob
ScorpiousDelectus 02 Oct, 2011
That has worked perfectly, thankyou so much🙂
ubungeeek 19 Oct, 2011
All the colours are written in CSS?
GreyHead 19 Oct, 2011
Hi ubungeek,

Yes.

Bob
This topic is locked and no more replies can be posted.