Check that the company is valid in select ajax

This commit is contained in:
snipe 2017-11-08 17:01:46 -08:00
parent 9097681c13
commit b36594f508

View file

@ -5,7 +5,7 @@
<select class="js-data-ajax" data-endpoint="companies" name="{{ $fieldname }}" style="width: 100%" id="company_select"> <select class="js-data-ajax" data-endpoint="companies" name="{{ $fieldname }}" style="width: 100%" id="company_select">
@if ($company_id = Input::old($fieldname, (isset($item)) ? $item->{$fieldname} : '')) @if ($company_id = Input::old($fieldname, (isset($item)) ? $item->{$fieldname} : ''))
<option value="{{ $company_id }}" selected="selected"> <option value="{{ $company_id }}" selected="selected">
{{ \App\Models\Company::find($company_id)->name }} {{ (\App\Models\Company::find($company_id)) ? \App\Models\Company::find($company_id)->name : '' }}
</option> </option>
@else @else
<option value="">{{ trans('general.select_company') }}</option> <option value="">{{ trans('general.select_company') }}</option>