Deleting image on checkbox
Hi - I have an update form that is using DFP to upload an image.
I want to include a checkbox to delete the file and it's associated entry in field for the article record.
I have the file part figured out - it deletes the file properly if deleteimage is checked:
<?php
$WA_DeleteFileResult1 = false;
if(("". ((isset($_POST["deleteimage"]))?$_POST["deleteimage"]:""). ""
!= "")){
$WA_DeleteFileResult1 = WA_FileAssist_DeleteFile("cmsassets/featureimages/", "".$row_WADAarticles['article_imagefile'] ."");
}
?>
But I can't figure out how to make the article_imagefile field blank if deleteimage is checked. I'm trying to change the default image, figuring if that was blank on update it would solve this. I've tried:
My checkbox in the form:
<input name="deleteimage" id="deleteimage" type="checkbox" value="1" />
and also in the form:
<input type="hidden" name="article_defaultfile" id="defaultfile" value="<?php if(("". ((isset($_POST["deleteimage"]))?$_POST["deleteimage"]:""). ""
!= "")){ ?><?php } else { ?><?php echo($row_WADAarticles['article_imagefile']); ?><?php } ?>" />
But no workie.
Any help would be appreciated! Is this the right way to do this?