Welcome Guest, Not a member yet? Register   Sign In
Call MVC Controller from with Javascript function
#1

[eluser]justmelat[/eluser]
I have a onclick event on a submit button in my CI app. So when user clicks submit, it goes to my js function that disables the button, but it does not continue processing. I used this "document.forms["mainFrm"].submit();", but because of the way the code is written I need it to go directly to a controller and finish processing.

So how do I call a CI controller from my js function?

Here is the function that is being called onClick:

Code:
function disableWhenSubmit()
{
alert ("You did get here");
var holdBtnElement = document.getElementById('btn_Add');
holdBtnElement.disabled = true;
holdBtnElement.value = "sending ...";
//document.forms["createRequestForm"].submit();
<?= base_url();?>index.php/request"; //this is what I am working on
}

and here is the button:
Code:
<input type="submit" id="btn_Add" name="btn_Add" value="Submit">


Messages In This Thread
Call MVC Controller from with Javascript function - by El Forum - 03-28-2012, 07:54 AM
Call MVC Controller from with Javascript function - by El Forum - 03-28-2012, 08:12 AM
Call MVC Controller from with Javascript function - by El Forum - 03-28-2012, 08:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB