js ajax doesn't work - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: js ajax doesn't work (/showthread.php?tid=64446) |
js ajax doesn't work - maschout - 02-20-2016 Hi, I have probably a simple yet annoying issue with a json query. I want to verify an input value against the value in de customers database (column cf1). With the code so far i recognize that the ajax is not functioning well, the result is always false therefore the function is ending without the desired check. I have a function in pos.js which i rewrited to add a checkup on input value. In this code i check the input value (ref) and check it on a function in pos.php if it belongs to the current user. js file ------ Code: $('#suspend_sale').click(function () { In pos.php i have a function to check the input value retrieved from the js code. Code: function get_user_pin($code) { In pos_model.php i have a function that actually calls the database and retrieves the value based upon the current user id Code: public function GetUserPINbyID($pincode) { What is false in my approach, and how can i resolve this? RE: js ajax doesn't work - skunkbad - 02-20-2016 Maybe something more like this, where the ref(code) is passed in the URL, as the controller method is expecting it: Code: $('#suspend_sale').click(function () { |