I'm stuck at the moment for (probably) e simple problem
i have added a custom file upload in categories.php
like this
Code: Select all
<div class="row mb-2" id="zPdf">
<label for="pPdf" class="col-form-label col-sm-3 text-left text-sm-right">PDF Datenblatt</label>
<div class="col">
<div class="custom-file mb-2">
<?php
echo tep_draw_input_field('datasheet_pdf', '', 'id="pPdf"', 'file', null, 'class="custom-file-input"').'<label class="custom-file-label" for="pPdf">'.$product->get('datasheet_pdf').'</label>';
?>
</div>
</div>
<div class="col-1"><a href="#" class="pdfDel"><i class="fas fa-trash text-danger"></i></a></div>
</div>
(and if this work, i want in the update /insert action to look if it's empty and if yes, i want to delete the old file)
But i can't get to work to empty the id="pPdf"
i tried document.getElementById("pPdf").html(''); but nothing changes...anybody a idea?
thank you!