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;
$.ajax(
{
url: urlCreateDev, // this contain the url //
type: 'Post',
contentType: 'apllication/html;
charset-utf-8',data:
{
divData, token
},
datatype: 'html',
success: function (result)
{
$('#DivInfoData').modal('hide')},
error: function (xhr, status, error)
{
alert(xhr.responseText);alert(xhr.status);alert(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.
Regards

Sachin SinghRank #66 · 26.2K reputationPosted Oct 1, 2020, 7:31 PM EDT
Asma KhalidRank #160 · 14.7K reputationPosted Oct 1, 2020, 8:47 PM EDT
Jignesh KumarRank #91 · 22.9K reputationPosted Oct 1, 2020, 11:27 PM EDT
Mageshwaran RRank #411 · 6.1K reputationPosted Oct 4, 2020, 4:03 AM EDT