php - Send form data with ajax to a REST CodeIgniter web service from a Phonegap mobile app -


I am programming a phonegap mobile app and I want to send data from my HTML form to my codinator web service but It's not working. Here is my form code:

  & lt; Form method = "POST" action = "" id = "myform1" & gt; & Lt; Input type = "text" id = "descr" name = "description" placeholder = "le .. gende .." & gt; & Lt; Id = "select_file" name = "select_file" & gt; Select & lt; Option value = "video" & gt; Vidà © o & lt; / Options & gt; & Lt; Option value = "son" & gt; Son & lt; / Options & gt; & Lt; Option value = "picture" & gt; Image & lt; / Options & gt; & Lt; Option value = "Autre" & gt; Atre & lt; / Options & gt; & Lt; / Select & gt; & Lt; Input type = "file" id = "myfile" name = "my_file" /> & Lt; Button type = "submit" id = "publierfile" & gt; Publication & lt; / Button & gt; & Lt; / Form & gt;  "Mysite-url / webservices / mycontroller / addTest", $ ('form # myform1'). Serialize (), function (data) {warning ("hello"); console.log (data);});});   

and my php function:

  public function addTest_post () {$ desc = $ this- & gt; Post ('description'); $ This- & gt; Feedback (array ("description" => $ desc), 201); }   

Thanksgiving Id is in advance for your help.

You need to make the following changes, also check your console for errors:

  1. $ ('# Myform1') Add event in the Submit (function) {// Argents as you accept the post 'event.preventDefault ();' 2. Public functions are using addTest_post () {//    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -