This topic is locked

Conditional Dynamic Tab color

1/9/2019 11:10:37 PM
PHPRunner General questions
M
Mark Kramer author

All,
Does anyone know how to change the color of a dynamic tab based on another fields value? I got the conditional If -else figured out just not sure how to make the tab change to the color.
$sql = "select * from employees";

$rs = CustomQuery($sql);

while ($data = db_fetch_array($rs)) {
$pageObject->addTab("EmployeeID='".$data["EmployeeID"]."'",

$data["FirstName"], $data["EmployeeID"]);

}
/**** Not sure how to tie this together
if ($data["FirstName"]= 'John') {

$color="red";

} else {

$color="green";

}

$value="<span style='color: " . $color . "'>" .$value . "</span>";
Thanks in advance

J
jacques 1/10/2019



All,
Does anyone know how to change the color of a dynamic tab based on another fields value? I got the conditional If -else figured out just not sure how to make the tab change to the color.
$sql = "select * from employees";

$rs = CustomQuery($sql);

while ($data = db_fetch_array($rs)) {
$pageObject->addTab("EmployeeID='".$data["EmployeeID"]."'",

$data["FirstName"], $data["EmployeeID"]);

}
/**** Not sure how to tie this together
if ($data["FirstName"]= 'John') {

$color="red";

} else {

$color="green";

}

$value="<span style='color: " . $color . "'>" .$value . "</span>";
Thanks in advance


my solution

add to custom css
.nav li.active a,

.nav li a:hover,

.nav li.active a:focus,

.nav li.active a:hover{

background-color:#42DCA3;

}