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
Saqib Abbas
NA
6
2.2k
Return only changed fields.
Jan 27 2015 5:23 AM
Hi there!
I am dynamically creating views using JQuery which consists of a tables that has editable fields i.e every td contains an input of type text. As soon as the user makes changes to any field I want the entire row corresponding to the field to be pushed into an array and then that array be passed to a http-post action method where the changes can be made to data base using ado.net. This is what i tried which does not work as the array passed on the action method is always empty can anyone tell me what is wrong with it? Thanks in advance.
//This function gets invoked on button click
function getAllChanges() {
//Declared earlier
arr1 = new Array();
$.each("#tblSubDepts tbody tr input[type='text']".change(function () {
//push parent, that is the 'tr' into arr1
arr1.push(this.parent);
}));
return arr1;
}
P.S
data attribute of ajax call that i am using
data: JSON.stringify({obj:(getAllChanges())})
Reply
Answers (
2
)
Search Box Functionality in Ajax Jquery
What is the wrong in the below code? I can't find the error.