When you use the select2 'Multiple select boxes' option it gives you the option to enter text. I want to remove this functionality so the user can only click/touch the options available and the text cursor doesn't show up.
You can see the 'Multiple select boxes' option on their example page: https://select2.github.io/examples.html
My Code. (I'm using Laravel 5 blade templating)
<div class="row searchBoxes show">
{!! Form::open(['method' => 'GET', 'id' => 'searchForm', 'name' => 'searchForm', 'route' => 'articles_path']) !!}
{!! Form::select('categoryList[]', $categories, null, ['class' => 'categorySelector', 'id' => 'categoryList', 'multiple']) !!}
{!! Form::select('dayList[]', $days, null, ['class' => 'distanceSelector', 'id' => 'dayList', 'multiple']) !!}
{!! Form::submit('MAKE ME HAPPY', array('id' => 'submitButton', 'class' => 'searchSubmit')) !!}
{!! Form::close() !!}
</div>
<script type="text/javascript">
$('#categoryList').select2({
placeholder: "CATEGORY",
minimumResultsForSearch: -1
});
$('#dayList').select2({
placeholder: "DAY",
minimumResultsForSearch: -1
});
</script>
EDIT: I found the info about 'Hiding the search box'. I have tried switching minimumResultsForSearch to 'infinity' and it still didn't work. Here is my app: www.gethappy.co.nz