Created
August 11, 2020 13:09
-
-
Save pradeeprjth/a50cb60ca83d8827c9b872e8de09ec19 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form name="_token" action="{{ route('bookings.toursDropDown', $tour->id) }}" id="tour-dropdown" method="get" value="<?php echo csrf_token(); ?>"> | |
{!! csrf_field() !!} | |
<select id="tour"> | |
<option value="">All</option> | |
@foreach ($tours as $tour) | |
<option value="{!! $tour->id !!}">{!! $tour->name !!}</option> | |
@endforeach | |
</select> | |
</form> | |
</td> | |
<script> | |
function dataFilter(id){ | |
$(id).on('change', function(e){ | |
var variable = e.target.value; | |
$(id + '-dropdown').submit(); | |
}); | |
}; | |
dataFilter('#tour'); | |
dataFilter('#category'); | |
dataFilter('#region'); | |
dataFilter('#dates'); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment