CrestRoad/laravel/resources/views/partials/register-location-fields.bl...

38 lines
2.0 KiB
PHP

@php
$showRequiredAsterisk = $showRequiredAsterisk ?? false;
$defaultCountry = $defaultCountry ?? 'India';
$cityField = $cityField ?? 'city';
$cityLabel = $cityLabel ?? 'City';
$persistCountryState = $persistCountryState ?? true;
$requiredMark = $showRequiredAsterisk ? ' <span class="text-danger">*</span>' : '';
$countryName = $persistCountryState ? 'country' : '';
$stateName = $persistCountryState ? 'state' : '';
@endphp
<div class="register-location-fields" data-city-field="{{ $cityField }}" data-default-country="{{ $defaultCountry }}">
<div class="row mb-3">
<label for="country" class="col-4 col-xl-3 col-form-label">Country{!! $requiredMark !!}</label>
<div class="col-8 col-xl-9">
<select @if($countryName) name="{{ $countryName }}" @endif id="country" class="form-control register-location-country" required>
<option value="">-- Select Country --</option>
</select>
</div>
</div>
<div class="row mb-3">
<label for="state" class="col-4 col-xl-3 col-form-label">State{!! $requiredMark !!}</label>
<div class="col-8 col-xl-9">
<select @if($stateName) name="{{ $stateName }}" @endif id="state" class="form-control register-location-state" required disabled>
<option value="">-- Select State --</option>
</select>
</div>
</div>
<div class="row mb-3 register-location-city-row">
<label for="city" class="col-4 col-xl-3 col-form-label">{{ $cityLabel }}{!! $requiredMark !!}</label>
<div class="col-8 col-xl-9">
<select id="city" class="form-control register-location-city-select" required disabled style="display: none;">
<option value="">-- Select City --</option>
</select>
<input type="text" class="form-control register-location-city-input" id="city_text" name="{{ $cityField }}" placeholder="Enter city" required disabled>
</div>
</div>
</div>