php - Text input with background color -
i have following code load colour of input field based on value of gap
echo "<td class='gap'>"; echo "<input name = gap-".$compi['competence_id']." type='text' readonly style='width:20px;' value='"; if(isset($compi['gap']) && $compi['gap']!=0){ echo $compi['gap']; } $color=''; if($compi['gap']>=0){ $color='#3cb371';$text="gap bigger 0"; } if($compi['gap']<0){ $color='#ffffff';$text="gap not"; } echo "' style='background-color:".$color.";'>"; echo $text."</td>";
the code prints correctly $text
colour of input not change..
it's because have 2 style
attributes <input>
tag - add both css rules in 1 attribute , should fine.
Comments
Post a Comment