No value in the call back - Jason - Jquery |
[eluser]Shiju S S[/eluser]
I have a script that executes on onchange Code: <$cript> Input tag: <div class="ui-widget"> <input id="tags" name="textPatientname" class="inp-form" type="text" placeholder="Search Patient Name or ID..." required > </div> Controller Code: public function get_patient_details()
[eluser]Otemu[/eluser]
You gave me a chuckle with this, set your data type to Json not dataType: "jason",
[eluser]Shiju S S[/eluser]
dataType: "json", Still not working. I was trying different things that is why the error came in the posting.
[eluser]Shiju S S[/eluser]
I tried this, but no result. Code: <$cript>
[eluser]Otemu[/eluser]
When you access the url directly www.yoursite.com/franchisee_lab_investigations/get_patient_details do you recieve a JSON result? Have you tried using GET instead of POST?
[eluser]Shiju S S[/eluser]
Code: <$cript> I get an output object object
[eluser]CroNiX[/eluser]
instead of alert(data) try console.log(data) and then look at the built in js console in your browser. Also, you are using json_encode() to send the json, but you don't seem to be sending json headers, so the json is probably getting sent with an html header.
[eluser]Shiju S S[/eluser]
There was two errors; 1. In the controller ( Select query). After that I got the success message from getJSON. 2. Second was in getting the correct index for the parameter data. Regarding the headers and log console as explained by one of the member, I have lesser idea and have to workout. Thanks for the help. Correct code is given below. Code: <!-- onchange patient name field --> |
Welcome Guest, Not a member yet? Register Sign In |