DEV Community

Md. Ashikur Rahman
Md. Ashikur Rahman

Posted on

Sending an Ajax Call by clicking a checkbox to Controller

$(document).ready(function() {
$("input[name='field_name']").click(function(){
var checkedValue = $("input[name='field_name']:checked").val();

var post_url = "controller_name/function_name/" + checkedValue;
$.ajax({
type: "POST",
url: post_url,
success: function(d) {

} //end success
}); //end AJAX
});
});

Top comments (0)