I am in a situation where I have 2 tabs and for each tab I have a partial views, I am using jquery UI to create my tabs.
I have two options for each user 1. to save, 2. to submit.
On save it will save for that particular tab ( where the tab contains model view 1) for the second the same ( where this tabe contains model view 2 )
How can I submit both models from both tabs with one click?
I have something like this in my save for tab 1 and tab 2.
My first view model.
self.save = function() {
$.ajax({
url: "MyTabs",
data: { data: ko.toJSON(self.firstVM) },
type: "post",
contentType: "application/json",
success: function(result) { alert(result); }
});
};
My second view Model.
self.save = function() {
$.ajax({
url: "MyTabs",
data: { data: ko.toJSON(self.secondVM) },
type: "post",
contentType: "application/json",
success: function(result) { alert(result); }
});
};