Dennis M. Marks wrote on 29 Nov 2003:
As I said the styles did not work for the OPTION statement when
used inline (styles=) or in <STYLES></STYLES>. When I set the
styles for both the SELECT and OPTION the same as you last saw
it, it only colored the first line.
I solved the problem by changing the SIZE parameter on the
SELECT statement which makes the page look better anyway. Now
the styles work. I am now using 3 different colors. It looks
like it does not work when the SIZE=1, at least on a Mac.
BTW: I tried using IE and Navigator on a Mac.
There's a syntax error in your (inline) script. In the for loop, you
have this code:
if (Trains[i][3][0]=="NA") {document.write("<OPTION id=blue>");};
else {if (Trains[i][3][0]=="DD") {
document.write("<OPTION id=red>");};
else {document.write("<OPTION id=green>");};};
The terminating semi-colons should not be there. You should re-write
it like this:
if (Trains[i][3][0]=="NA") {
document.write("<OPTION id=blue>");
} else if (Trains[i][3][0]=="DD") {
document.write("<OPTION id=red>");
} else {
document.write("<OPTION id=green>");
}
I also feel that elseif equivalent statements are more readable if
presented as I wrote above. Of course, that's purely a subjective
comment. If you don't like it, the above could be presented:
if (Trains[i][3][0]=="NA") {
document.write("<OPTION id=blue>");
} else {
if (Trains[i][3][0]=="DD") {
document.write("<OPTION id=red>");
} else {
document.write("<OPTION id=green>");
}
}
Mike
--
Michael Winter
M.******@blueyonder.co.uk.invalid (remove ".invalid" to reply)