Posted on 2016-06-01 02:49:57
In this tutorial I will show you that how to create select box with searching support you can search your desired option rather than finding it by scroll. I have used a jquery plugin select2 to implement this tasks, its very easy and simple to understand it help you to give facility to users if you have large lists to select.
Before use jquery select 2:
After use select2 jquery:
How to use it:
Include jQuery libraries and css
You can download file js and css select2 at here
jQuery select2 trigger:
In view file.
you need add class "schoolSearch" to select box in cakephp. $schools is array data.
<?php echo $this->Form->input('school_id', array('options' => $schools, 'label'=>false, 'class'=>'schoolSearch')); ?>
You can use for form select in html: