How to disable a checkbox based on date using php?
Posted
by udaya
on Stack Overflow
See other posts from Stack Overflow
or by udaya
Published on 2010-05-01T05:12:46Z
Indexed on
2010/05/01
5:17 UTC
Read the original article
Hit count: 227
I have iterated a table based on my query result... I have a column lastDate
it contains a date value like 01/24/2010
... Now i have to check the date value with the current date if currentdate
is less than or equal to lastDate
i have to enable the checkbox else disable it..... Any suggestion how it can be done in php...
Here is my code
<? if(isset($comment))
{ echo '<tr><td class=table_label colspan=5>'.$comment.'</td></tr>'; } ?>
<td align="center" class="table_label" id="txtsubdat">
<?
$dd=$row['dDate'];
if($dd=='')
{
}
else
{
$str = $dd;
$dd = strtotime ( $str );
echo date ( 'm/d/Y' , $dd );
} ?>
</td>
<td align="center">
<input type="checkbox" name="group" id="group"
value="<?=$row['dAssignment_id']?>" onclick="checkdisplay(this);">
</td>
<? } ?>
© Stack Overflow or respective owner