0
I am using the PHP language and the Laravel Framework 5. In the form validation, if it contains any blank field or with unaccepted character sizes, clicking save shows the validation message, but the fields of the textarea and select option that were filled are empty. How to keep these types of data in the form after clicking save when some field is incorrect?
Textarea code:
<textarea class="form-control" name="descricao" id="descricao"></textarea>
My select only has one option because it takes the values directly from the database. Select option code:
<select class="form-control" name="categoria" id="categoria">
<option value="null"> Selecione uma categoria </option>
@foreach($categorias as $row)
<option value="{{ $row->id }}"
{{ $row->nome }}
</option>
@endforeach
</select>
Graziane welcome to Stack Overflow, please do not duplicate questions unnecessarily. It seems to me that João’s answer solves both problems with inputs, as selects and textareas, I recommend. Now if the problem is another could try to explain?
– Guilherme Nascimento
A understood what happened, asked a question about input then asked a question about textarea and select, however in this how John answered about the 3 situations there mark both as duplicate [and just to join the content, is not a penalty =)
– Guilherme Nascimento