I have a form to send someone a message, and I need to create a list of people to the user pick one and send him the message.
So I've created a search field that shows that list:
$('#name').keyup(function(){
var name, goURL;
goURL = site_url + 'events/search';
name = $(this).val();
$.post(goURL, {name : name}).done(function(data){
$('.results').html(data);
});
});
Then I get a list from users, that comes from a method of codeigniter and in each user I have a button that allows me to pick this user.
$('.results').on('on', '.select-btn', function(){
alert('Test');
});
But when I click, nothing happens. How to proceed? Thank you and sorry for my bad English.