Skip to content

Instantly share code, notes, and snippets.

@irobinson
Created December 3, 2010 03:09
Show Gist options
  • Save irobinson/726528 to your computer and use it in GitHub Desktop.
Save irobinson/726528 to your computer and use it in GitHub Desktop.
$('#submit-items').click(function(e) {
e.preventDefault();
if ($('#Form').validate().form()) {
var items = new Array();
$('#income-list li').each(function(intIndex) {
var $item = $(this);
var incomeItem = {
CategoryId: $item.data('categoryId'),
Amount: $item.data('amount')
};
items.push(incomeItem);
});
var proxy = new ServiceProxy("/DesktopModules/AdvancedAjaxInDnnDemo/WebService1.asmx/");
proxy.invoke("Save", {
userId: DemoViewContext.UserId,
incomeItems: items
}, function(result) {
alert(result);
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment