Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- $('#user-list').select2({
- ajax: {
- url: "<?php echo base_url() . 'User_basic/fetch_mobile_numbers'; ?>",
- dataType: 'json',
- type: "post",
- delay: 250,
- data: function (params) {
- return {
- searchTerm: params.term // search term
- };
- },
- processResults: function (response) {
- console.log(response);
- return {
- results: response
- };
- },
- }
- });
- });
- <select name="phone_number" id="user-list" placeholder="Enter Number" class="form-control" multiple="multiple" required>
- <option value="" id="numbers-list"></option>
- </select>
Add Comment
Please, Sign In to add comment