-
this is my dropdown selection field inside the form
Class ID -select- @foreach($aiclasses as $aiclass) option value=""> @endforeach -
This is the textbox i want to autofill from db
Required Fees -
this is my ajax code
$(".info_id").change(function() { var id = $(this).val(); $.ajax({ url: '/info/' + $(this).val(), type: 'get', data: {id : 'id'}, success: function(data) { if (data.success === true) { $("#info_id").value = data.info; } else { alert('Cannot find info'); }@push('js')
}); });}, error: function(jqXHR, textStatus, errorThrown) {}@endpush
-
this is my controller
public function getInfo($id) { $fill = DB::table('aiclasses')->where('id', $id)->pluck('fee'); return \Response::json(['success'=>true, 'info_area'=>$fill]); }
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire