Welcome Guest, Not a member yet? Register   Sign In
JQuery post parameters do not get to my controller
#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


Messages In This Thread
RE: JQuery post parameters do not get to my controller - by savitasandeep - 06-13-2017, 04:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB