TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Schleid Alex
NA
361
48.2k
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;
$.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
Reply
Answers (
4
)
Display Image In GridView
Posting bootstrap modal containing partial view using jquery ajax post