Edit File: 064edea943b957cdb554c34e864d8c6b2cefdb9c.php
<script> $(document).ready(function() { $('#city_id').change(function() { var cityId = $(this).val(); console.log(cityId); var url = "<?php echo e(route('get_city_neighborhoods', ':cityId')); ?>"; url = url.replace(':cityId', cityId); if (cityId) { $.ajax({ url: url, type: 'GET', dataType: 'json', success: function(response) { var neighborhoods = response.data; var neighborhoodId= $('#neighborhood_id'); neighborhoodId.empty(); neighborhoodId.append( '<optgroup label="<?php echo e(__('admin.select_neighborhood')); ?>"></optgroup>' ); if (neighborhoods.length > 0) { $.each(neighborhoods, function(key, value) { neighborhoodId.append('<option value="' + value.id + '">' + value.name + '</option>'); }); neighborhoodId.prop('disabled', false); } else { neighborhoodId.prop('disabled', true); } } }); } else { neighborhoodId.empty(); neighborhoodId.prop('disabled', true); } }); }); </script><?php /**PATH /home/thunderw/public_html/resources/views/admin/providers/parts/get_city_neighborhoods.blade.php ENDPATH**/ ?>
Back to File Manager