1
I have a field of type select that I select a driver, I would like when I select this driver the text field received the phone of this driver, which already comes with the information of the line of select!
<div class="row">
<div class="col-md-9">
<div class="form-group">
<label>Motorista:</label>
<div class="input-group">
<div class="input-group-addon icone-input">
<i class="fa fa-users"></i>
</div>
<select id="select-motorista-ex" id="f_rec_analist_fiscal" name="f_rec_analist_fiscal" style="width: 100%">
<option value='1'>Selecione um parceiro</option>
@foreach($parceiros as $p)
<option value='{{$p->parc_cpf_cnpj}}'>{{$p->parc_razao_social}}</option>
@endforeach
</select>
</div>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label>Contato</label>
<div class="input-group">
<div class="input-group-addon icone-input">
<i class="fa fa-edit"></i>
</div>
<input type="text" name="f_rec_motor_tel" id="f_rec_motor_tel" value="{{ old('f_rec_motor_tel') }}" class="form-control" maxlength="15" placeholder="(XX) XXXXX-XXXX">
</div>
</div>
</div>
</div>
Follow picture:
Someone could help me because I don’t quite understand the ajax yet!
Possible duplicate of AJAX with HTML data return
– Darlei Fernando Zillmer