I have a dynamic form that has text fields which change to input boxes when they need to be updated.
When they have been updated and the user clicks submit I want to add the updated values to a json string which i can post to an ASP.NET script.
Here is the html of 2 rows in the table:
Colleague 1:
Del
Colleague 2:
Del
Here is the jQuery I'm using to detect which input boxes have been updated:
$("#subdetails").click(function () {
$("#mantab input[type=text]").each(function () {
if ($(this).val() !== this.defaultValue) {
//code to create json string
}
});
});
This is an example of a json string i would like to create if the following field were updated:
{
"1":{
"c1nametb": "newname",
"c1exttb": "22227",
}
"2":{
"c2eaddtb": "neweadd@company.co.uk",
"c2pnotb": "0111122210",
}
}
Can any one please help me with the code to create this string, or advise on a better way of doing this?
Thanks
Ryan
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment