I have a form where if I check a particular check box it sets an input form to some value, today's date. I have tried unsuccessfully to have it clear the field if I uncheck the checkbox. My javascript skills are limited 
Code:
function outdate()
{
if (document.getElementById("outc").value == "on"){
document.getElementById("dp").value = "<?php echo $today; ?>"; }
else{ document.getElementById("dp").value = ""; }
}
<body>
PHP Code:
<?php
if ($out == 1) {$ck1 = "checked";}else{$ck1 ="";}
echo "<INPUT type= 'checkbox' ".$ck1." id='outc' onclick='outdate()' name = 'out'>";
echo "<input type='text' size='9' name='date_paid' id ='dp' value ='".$a_row['Odate']."'>";
?>
</body>
Bookmarks