Guest User

Untitled

a guest
Oct 16th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. $(document).ready(function() {
  2. $('#user-list').select2({
  3. ajax: {
  4. url: "<?php echo base_url() . 'User_basic/fetch_mobile_numbers'; ?>",
  5. dataType: 'json',
  6. type: "post",
  7. delay: 250,
  8. data: function (params) {
  9. return {
  10. searchTerm: params.term // search term
  11. };
  12. },
  13. processResults: function (response) {
  14. console.log(response);
  15. return {
  16. results: response
  17. };
  18. },
  19. }
  20. });
  21. });
  22.  
  23. <select name="phone_number" id="user-list" placeholder="Enter Number" class="form-control" multiple="multiple" required>
  24. <option value="" id="numbers-list"></option>
  25. </select>
Add Comment
Please, Sign In to add comment