Forum Moderators: open

Message Too Old, No Replies

Firefox uncooperative in style change

chrome and safari work

         

Baruch Menachem

7:00 am on Jul 26, 2010 (gmt 0)

10+ Year Member



more home work issues. Thanks for the previous help
function SetBcolor()
{
var message=document.getElementById('errcode');
var beecolor=document.getElementById('bcolor').value;
var delecti=document.getElementById('corpus');
if (screen(beecolor))
{
delecti.style.backgroundColor=beecolor;
}
else message.innerHTML="not a valid Hexadecimal code. Use only values 0-9 & A-F"
}

the body tag has the id Corpus.
this code is called by onblur
bcolor is the ID of a text box
screen is not implemented yet. It will have a regex function to make sure only valid values are put in the text boxes.


Works great in Chrome and Safari. (I don't know about explorer yet) Miserable failure in Firefox. Does firefox use a different way of getting the ID?

Baruch Menachem

7:04 am on Jul 26, 2010 (gmt 0)

10+ Year Member



accidently solved it.

delecti.style.backgroundColor="#"+beecolor;