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

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -