views:

27

answers:

2

I have Made the CheckboxList like this?

<%foreach(ListItem m in bootcamp.STPs.ProjectManagement.Controllers.MemberController.JALLMembers()){%>
  <label for=""><%= m.Text %></label>  
  <input id="Mana" type="checkbox" value="<%= m.Value %>" name="chkbx" />
<%}%>

How can I get the Values of selected checkboxes through ajax script in controller?

I am using Asp.net MVC?

A: 

I have find the answer

    var data2="";

    $("input[name=chkbx]").each(function()
    {
    if($(this).attr("checked")==true || $(this).val()==undefined)
    return false;
    data2 +=$(this).val() + ",";
    });

By this you can collect all selected checkboxes Values with comma seprated.

SAHIL SINGLA
A: 

Or serialize the form?

$('form').submit(function() {
  alert($(this).serialize());
  return false;
});
Mark