Problem sending data from ajax to controller |
[eluser]bigmac90[/eluser]
Hey Guys I wonder if anyone can help me. I'm trying to send multiple inputs from the view to my controller from a .js file using the $.ajax function. However, the only problem is my data isn't being going over to the controller. My JS Code: Code: $('#bttnSubmit').click(function() { My Controller Code Code: function ajax_test() { Does anyone know whats wrong??
[eluser]CroNiX[/eluser]
What happens when you manually go to http://localhost/ProjectSage/index.php/site/ajax_test?
[eluser]bigmac90[/eluser]
I keep getting three error messages saying something like undefined $company, etc. With an echo "It Works".
[eluser]CroNiX[/eluser]
Try using CI's input::post() method instead of using the global $_POST, which get's sanitized. So what does your console show when the ajax request is sent?
[eluser]bigmac90[/eluser]
hey guys thanks for the replys. @CroNiX, tried using the CIs input::post and still got the same result. @ivantcholakov, my code for the form looks like: Code: echo form_open(); |
Welcome Guest, Not a member yet? Register Sign In |