I have in my view a select that receives the data of the functions and the lists.
<select id="id_mfuncao" name="id_mfuncao" class="form-control">
<option value=""><< selecione >></option>
@foreach($mfuncoes as $mfuncao)
<option value="{{ $mfuncao->id }}">{{ $mfuncao->nome }}</option>
@endforeach
</select>
Apart from the id and the name, I also get the description of the functions. How can I do to load the description of the selected function in a textfield?
<input readonly="" type="text" id="descricao" name="descricao" class="form-control">
I do not think I need to use ajax to fetch the value again since I already have it loaded, but I lack knowledge and I did not get a term to search for a solution on the web.
These are the data I get from the function:
Whenselected"General Officer ..." I want to show the description in textfield.