0
<td><input name="power" type="checkbox" disabled="disabled" <?php if($row['power_backup']=='on') echo "checked"; ?> /></td>
<td>Power Backup</td>
<td style="width:25px;"><input name="purifier" disabled="disabled" type="checkbox" <?php if($row['water_purifier']=='on') echo "checked"; ?> /></td>

I have some checkboxes ,what i am trying to do if a checkbox is checked(its value is on)
it should bold.

need suggestions.

Edited by mike_2000_17: Fixed formatting

3
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by pzuurveen
0
<td>
<input name="power" type="checkbox" disabled="disabled" 
<?php if($row['power_backup']=='on') echo "checked"; ?> />
</td>
<td><?php if($row['power_backup']=='on') echo "<b>Power Backup</b>" else echo "Power Backup"; ?></td>

<td style="width:25px;">
<input name="purifier" disabled="disabled" type="checkbox" 
<?php if($row['water_purifier']=='on') echo "checked"; ?> />
</td>
<td><?php if($row['water_purifier']=='on') echo "<b>Water Purifier</b>" else echo "Water Purifier"; ?> </td>

Edited by urtrivedi: n/a

0
<td>
<input name="power" type="checkbox" disabled="disabled" 
<?php if($row['power_backup']=='on') echo "checked"; ?> />
</td>
<td><?php if($row['power_backup']=='on') echo "<b>Power Backup</b>" else echo "Power Backup"; ?></td>

<td style="width:25px;">
<input name="purifier" disabled="disabled" type="checkbox" 
<?php if($row['water_purifier']=='on') echo "checked"; ?> />
</td>
<td><?php if($row['water_purifier']=='on') echo "<b>Water Purifier</b>" else echo "Water Purifier"; ?> </td>

I am trying to bold checkbox which is selected,can i do this
Need suggestion.

0

my code will bold text around checkbox.
if you want to change style of checkbox then create 2 style class and apply conditionally using php

0

checked is simular as disabled
so use

<td>
<input name="power" type="checkbox" disabled="disabled"
<?php if($row['power_backup']=='on') echo 'checked="checked"'; ?> />
</td>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.