Skip to content

Instantly share code, notes, and snippets.

@mangantj
Created March 26, 2013 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mangantj/5247159 to your computer and use it in GitHub Desktop.
Save mangantj/5247159 to your computer and use it in GitHub Desktop.
$(function () {
$("#setFeesToPaid").click(function () {
var checkedUnPaidFees = $("input[name=paid]:checked");
if (checkedUnPaidFees.length > 0) {
$.ajax({
url: "/Fees/SetFeesToPaid",
type: "POST",
dataType: "JSON",
data: JSON.stringify(collectCheckBoxIds(checkedUnPaidFees)),
contentType: 'application/json; charset=utf-8',
success: function (data) {
//alert("Me Data Here");
}
});
}
});
});
function collectCheckBoxIds(inputCollection) {
var Ids = [];
$(inputCollection).each(function () {
var id = $(this).attr('data-id');
Ids.push(id);
});
return Ids;
}
public ActionResult SetFeesToPaid(Fee data)
{
//GOING TO DO STUFF
return Json(new
{
bob = "JELLO"
},
JsonRequestBehavior.AllowGet);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment