I have a difficulty that I can not solve even though it is a simple situation. I'm trying to validate a input field with%, the field needs to be filled, what I have:
Form:
<form enctype="multipart/form-data" class="form-horizontal" id="frmDoc" method="post">
<legend>Selecione o PDF</legend>
<div class="form-group">
<label class="col-md-2 control-label">Arquivo</label>
<div class="col-md-10">
<input name="Arquivo" type="file" class="btn btn-default" id="Arquivo">
<p class="help-block"> Extensão permitida <strong>PDF</strong>. </p>
</div>
</div>
Attempt to validate:
if (!isset($_FILES)): $retorno = array('codigo' => 0, 'mensagem' => ' Informe o arquivo para Upload'); echo json_encode($retorno); exit(); endif;
The script is running even without informing the file.