Welcome Guest, Not a member yet? Register   Sign In
JQuery post parameters do not get to my controller
#11

Try to use 

var_dump($_GET);

instead of var_dump($_POST).

Yours
Reply
#12

When you get ajax problems you should view your "Console" window of Chrome browser. More over apply the .fail() deferred method to catch any errors encountered by ajax call. To apply jQuery Post method use the following code. Note I have passed nameValue to controller and used .done() and .fail() which are deferred objects in jQuery.

Code:
var url = $("#form_id").attr('action');
$.post(url,
   {
       nameValue: $("#new_loc_loc_name").val()
   })
   .done(function (result, status, xhr) {
       alert(result)
   })
   .fail(function (xhr, status, error) {
       alert(status + " " + error + " " + xhr.status + " " + xhr.statusText)
   });
Reply




Theme © iAndrew 2016 - Forum software by © MyBB