[development] Colored text in a form
Carl Jester
cjester at peladon.com
Tue Apr 26 19:32:18 UTC 2011
I feel like I'm overlooking something simple. I'm writing a module that provides a form, I need to display some info along with the form, and sometimes I want to make a bit of that info really stand out.
$foo = $info1 . ' ' $info2 . ' ' . $info3;
$form(['foo']=array(
'#value' => $foo,
);
Gives me:
info1 info2 info3
OK, so far so good.
Now if I set up $foo like this:
if ($info3 == $X) {
$foo = $info1 . ' ' $info2 . ' <font color:red>' . $info3 .'</font>';
} else {
$foo = $info1 . ' ' $info2 . ' ' . $info3
}
Then when foo == x I get:
info3
info1 info2
Info3 is indeed red, but on the previous line. I've also tried inline style with <span style:...> and gotten the same result.
I just need to make info3 stand out in certain cases. What am I missing here?
Thanks,
Carl
More information about the development
mailing list