Advertisement
Guest User

Untitled

a guest
Sep 6th, 2017
488
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. <input type="text" value="test@gmail.com" class="form-control CCContactList" />
  2.  
  3. $(document).on('keyup', ".CCContactList", function(e) {
  4. e.preventDefault();
  5.  
  6. var cemaillist = [
  7. {"name": "John@gmail.com", },
  8. {"name": "doe123@gmail.com",},
  9. {"name": "kevi@gmail.com", }
  10. ];
  11.  
  12. $('.CCContactList').tagsinput({
  13. typeahead: {
  14. source: cemaillist.map(function(item) {
  15. return item.name
  16. }),
  17. afterSelect: function() {
  18. this.$element[0].value = '';
  19. },
  20. hint: true,
  21. highlight: true,
  22. minLength: 1,
  23. }
  24. });
  25.  
  26. });
  27.  
  28. var cemaillist=[ {
  29. "John": "John@gmail.com",},
  30. {"Doe": "doe123@gmail.com",},
  31. {"Kavin": "kevi@gmail.com",}];
  32.  
  33. $(document).ready(function() {
  34. $('.form-control').keyup();
  35. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement