I’m using phpmaker 2019:I have this code in Row_Updating
if(CurrentUserLevel() == '1' || CurrentUserLevel() == '-1') {
if(!empty($rsnew["ue_correspondencia_in_archivos"])) {
return TRUE;
} else {
$this->setFailureMessage("No se ha seleccionado el o los nuevos archivos PDF");
return FALSE;
}
} else {
return TRUE;
}
When it returns false the uploaded files dissapear from the edit page, it onlu show the select file button and the submit button disables, I want to know how to show the files when the page returns false or a way to compare databse field value with fields added in form, the purpose of these is to prevent keeping the same files on edit.thanks in advance.
Maybe I wasn’t clear enough, this is what I have at this moment on Form_CustomValidate event (client side):
I WANT TO BE ABLE TO COMPARE $getdata with $getfile, I get the same result on both fields.
$getdata = $ue_correspondencia_in->ue_correspondencia_in_archivos->Upload->FileName; <----- I WANT TO GET A SINGLE OR MULTIPLE FILES NAMES BASED ON WHAT I HAD CHOSEN ON FORM FIELD
$getfile = ExecuteScalar("SELECT ue_correspondencia_in_archivos FROM ue_correspondencia_in WHERE ue_correspondencia_in_ID = '". $_GET["ue_correspondencia_in_ID"] ."'");
?>
var frmdata = <?php echo json_encode($getdata); ?>;
var dbdata = <?php echo json_encode($getfile); ?>;
var m2=document.getElementById('x_ue_correspondencia_in_archivos').value;
if (dbdata == frmdata ) {
alert("Suba el documento correspondiente a este folio | formulario: "+frmdata+" db: "+dbdata);
return false;
} else {
return true
}