Schleid Alex

Schleid Alex

  • 1.7k
  • 291
  • 7.3k

Posting form data using jquery ajax with html

Oct 1 2020 1:50 PM
I have a view with 4 element ID Name Location I want to submit this form using jquery. The form id is "divData"
Here is my jquery save function
function SaveChanges()
alert("Do you want to save the changes?")
var token = $('input[name="__RequestVerificationToken"]').val();
var urlCreateDev = $('#urlCreateDev').val()debugger;
url: urlCreateDev, // this contain the url //
type: 'Post',
contentType: 'apllication/html;
divData, token
datatype: 'html',
success: function (result)
error: function (xhr, status, error)
This will not work...
One more thing. My controller will return true when data is successfully posted to the database and false when not, I would like to be able to evaluate the return data from my controller in order to hide or keep the modal form
Thank you! Any help will be greatly appreciated.

Brought to you by:

Answers (4)