
December 17th, 2003
07:30 PM
javascript checkbox to colo(u)r cell
ok heres the problem - been looking at a html book which has some java script in and cant get my head round it and after 2 days my head is still hurting and still cant get this to work
i want a checkbox to color the table cell it is in - for example when it is checked the cell shud go red and when not checked the cell shud be green. note the checkbox is in the cell i want colored.
well i can get this to work but however also i wud like the cell to be colored upon loading the document. so upon loading if box is checked then cell shud be red if not then green. to say whether this box is checked or not php will be used this will simply send to the input/checkbox tag with 'checked' option printed or not.
does this make sense?
___________________
No one will ever know the meaning of life.

December 17th, 2003
07:56 PM
Neversidian
Status: Offline!
You're such a brain Fred
I never could get the conditional operator. (i believe that is what it is.)
___________________
Free-Speed Nation

December 17th, 2003
09:05 PM
isnt that just a 'if' statement?
___________________
No one will ever know the meaning of life.

December 17th, 2003
09:09 PM
Originally posted by .sykil
I never could get the conditional operator. (i believe that is what it is.)
It looks slightly complex at first but once you see an example of it's usage and understand how it works it's quite simple.
Originally posted by asmega
isnt that just a 'if' statement?
It functions similar to an if statement however it uses less syntax and makes more sense to use when you only have one statement you want to execute for each different result of the test as opposed to using an if/else block.
___________________


December 19th, 2003
04:20 PM
how do i get this to work for 5 checkboxes for 5 different cells for 5 different tables?
___________________
No one will ever know the meaning of life.