1
I have in my view a select that receives data from functions and 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 id and name, I also get the description of the functions. How can I load the description of the selected function into a textfield?
<input readonly="" type="text" id="descricao" name="descricao" class="form-control">
I don’t think we need to use ajax to search again for the value since I already have it loaded, but I lack knowledge and could not find a term to search for a solution on the web.
This is the data I get from the function:
When "Officer General..." is selected I want to show the description in the textfield.
Do you use jQuery in your project? A solution can be made with jQuery or even pure Javascript.
– Pedro Camara Junior
I use jQuery yes.
– Raylan Soares