I feel that only text input fields respond as expected when I write code to re-fill the form (when errors were found, for example), or when I click the "Edit" button from the table row and I go to the form that is being edited, The field for the text field is not populated, so it appears empty, so if I save it, I will delete the contents of the text field. (I know that recently I have been asking a number of questions, the reason is that I basically finished my application, and I left for the end small things that I could not solve, so I apologize for this).
here is an example of what i am saying:
This WORKS to enter a text field:
WORKS
<div class="col-md-4"> <label for="relato">Charges</label> <input type="text" name="expenses" maxlength ="30" class="form-control" value = "{{ $user->expenses }}"/> </div>
That is, $ user-> costs fills the text field of the form that appears when you click the "Edit" button in the table row.
However, this does not work for the textarea field:
<div class="row"> <label for="relato">Description</label> <textarea name ="message" id="message" rows="5" cols="100" value = "{{ $user->message }} class="form-control" </textarea> </div>
Cm? that part of $ user-> message will not pass content to the form text field.
Similar: with Input :: old
Works for text input field
WORKS
Email: <input type="text" class="form-control" name="email" {{ (Input::old('email')) ?' value ="' . e(Input::old('email')). '"' : '' }}>
DOES NOT WORK IN TEXTAR
<div class="form-group"> <label for="relato">Une petite description</label> <textarea id="message" name = "content" rows="10" cols="50" onKeyPress class="form-control" {{ (Input::old('content')) ?' value ="' . e(Input::old('content')). '"' : '' }} "> </textarea>{{ $errors->first('content')}} </div>
And the controller also tries to replenish the form by sending β withInput
if($validator->fails()){ return Redirect::route('usersgetformtopostads') ->withErrors($validator) ->withInput(); }
but, as I said, it only works for text fields. Does not change the list of favorites or text files
By the way, I looked at a related question, where the author says that he could not populate the "File" field, and he was told that "you can not", and he gave it as the correct answer, however, I was able to repopulate uploaded files having no problem with this.