Checking Ajax POST request |
[eluser]HooJee[/eluser]
Hi Guys If I am making a POST request via AJAX how can I check whether the POST request was made in CI ? Usually The following works for a page refresh form submittion but not for an ajax request since it requires the submittion button name: Code: if($this->input->post('addBtn')) {
[eluser]umefarooq[/eluser]
can you post javascript how you are posting your data to CI.
[eluser]Krzemo[/eluser]
You get Ajax post value exactly the same way as regular form. Firefox and Firebug may help debuging.
[eluser]jdfwarrior[/eluser]
[quote author="HooJee" date="1249579979"]Hi Guys If I am making a POST request via AJAX how can I check whether the POST request was made in CI ? Usually The following works for a page refresh form submittion but not for an ajax request since it requires the submittion button name: Code: if($this->input->post('addBtn')) { Not understanding the question. You want to be able to check and see if a CI based system made the post? Or are you trying to find out if the post to CI worked? If your using jQuery, I made a quick post one day about posting to CI using jQuery. See my sig.
[eluser]Spicer[/eluser]
I have used this solutions in the past. http://snipplr.com/view/1060/check-for-ajax-request/ There are a few different ways to do it, but from my understanding you want to do something like this. Code: if(isajax()) |
Welcome Guest, Not a member yet? Register Sign In |