I’m doing a search using CI and Jquery, well i’m very novice to this, this is my first time,
i have done this code but i can’t figure out how to send data to the controller and search for a value entered in the text box? can you guys help me to figure this out?
here is my code
$(document).ready(function(){
$('#search').live('click',function(eve){
eve.preventDefault();
$.get('<?php echo base_url();?>index.php/search_controller/perform', function(data) {
$('#result').html(data);
});
});
});
regards,
Rangana
Adding the textbox value to the url should work. Also, I have removed the php code for adding the baseurl. Codeigniter will take care of adding that for you.
You will have to add an argument to the
performfunction of yoursearch_controllerto pickup the textbox value being passed, or you can use the routing methods to get the parameter in the url (more info over here).