[eluser]CodeIgniteMe[/eluser]
To call on CI Controller from JS without reloading the page would somewhat require an AJAX request or so.
You can use what NeoArc suggest, use jQuery because it has a cool syntax and has AJAX bundled with it.
This is a sample code for your issue.
Code:
<$cript src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></$cript>
<$script>
//save the URL path to your MVC controller
var request_url = '<?php echo site_url('request'); /*requires URL Helper*/ ?>';
//execute codes when HTML document is ready
$(document).ready(function(){
// holds the click event of the button with id=btn_Add
$('input#btn_Add').click(function(e){
//save the button object for future purpose
btnAdd = $(this);
//prevent normal postback
e.preventDefault();
//create an AJAX request
$.ajax(
'url':request_url, //URL of the request
'type':'post', //POST method
'success':function(){ //execute when successful
btnAdd.attr('disabled','true'); //disable the button
btnAdd.val('sending ...'); //change the button text value
}
});
});
</$script>