How to check if validation fails while saving data in sharepoint spservice

558 Views Asked by At

I am using following code to save items in sharepoint.

 $().SPServices({
operation: "UpdateListItems",
async: false,
batchCmd: "New",
listName: "Share Point List",
valuepairs: [["Title", fnameVal], ["LastName", lnameVal], ["Gender0", genderVal], ["DateOfBirth", birthDateVal], ["Email0", emailVal], ["City", cityVal], ["Country", countryVal]],
completefunc: function (xData, Status) {
alert("Data Saved! and Please check your List");
}
});

It works perfectly when data is saved but when it don't save for some validation I still get the alert message. How can I check if validation failed and for which fields validation failed?

1

There are 1 best solutions below

0
On

Your answer is in this SPServices forum post: http://spservices.codeplex.com/discussions/393036

I believe Marc has an issue open to add the methods I posted in that thread to SPServices in some future release.