Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Background Colour on Checkboxes in Firefox

Status
Not open for further replies.

ggriffit

Programmer
Joined
Oct 25, 2002
Messages
1,578
Location
GB
I don't seem able to set them using Javascript, but I get no errors and the same code works for IE. I know the code is browser compliant as textboxes are coloured in the same function in both browsers without an issue.
 
Code please. If we can't see your code, we can't suggest what's wrong. IE is much more forgiving than FF in loose syntax.
 
testpage is :

<html>
<head>
<script language="javascript">
function doit()
{
for (i=0;i<document.myForm.elements.length;i++)
{
document.myForm.elements.style.background="red";
}
}
</script>
</head>
<body>
<form name="myForm">
<input type="text" name="a" size="10"><p>
<input type="checkbox" name="b"><p>
<input type="button" name="c" onclick="doit()">
</form>
</body>
</html>
 
AFAIK that is a known oddity between IE and Netscape-based browsers, and there is nothing you can do for it short of surrounding the checkbox with a styled div.

*cLFlaVA
----------------------------
[tt]tastes great, less filling.[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top