Jquery-Get status of check box from php

by barkkathulla 2013-07-26 09:40:24

Get status of checkbox in jquery


<script type="text/javascript">

$(document).ready(function(){
$('.btnadd').click(function(){
var checkValues = $('input[name=checkboxlist]:checked').map(function()
{
return $(this).val();
}).get();

$.ajax({
url: 'htmlpage.php', //this is the html page for passing checkbox values
type: 'post',
data: { ids: checkValues },
success:function(data){

}
});
});
});

</script>


<input type="checkbox" name="checkboxlist" value="1" checked="checked" />
<input type="checkbox" name="checkboxlist" value="2" checked="checked" />
<input type="checkbox" name="checkboxlist" value="4" />
<input type="checkbox" name="checkboxlist" value="5" checked="checked" />
<input type="checkbox" name="checkboxlist" value="6" />

793
like
0
dislike
0
mail
flag

You must LOGIN to add comments