NOTE: You can get all selected checkbox values on button click using this function just add the functioni on buttonclick event.
function getSelectedCheckboxValue(){
var messageList = [];
var checkboxId = new Array();
var checkboxIdValue = new Array();
var unescapevalue = "";
$("input[type='checkbox']:checked").each(
function() {
checkboxId[i] = $(this).val();
checkboxIdValue[i] = $(this).attr('id');
unescapevalue = unescape(checkboxId[i])+"||||||";
i++;
messageList.push(unescapevalue);
}
);
alert("messageList: "+messageList);
}
//here in message list array u can get value of checkbox which are selected.
var messageList = [];
var checkboxId = new Array();
var checkboxIdValue = new Array();
var unescapevalue = "";
$("input[type='checkbox']:checked").each(
function() {
checkboxId[i] = $(this).val();
checkboxIdValue[i] = $(this).attr('id');
unescapevalue = unescape(checkboxId[i])+"||||||";
i++;
messageList.push(unescapevalue);
}
);
alert("messageList: "+messageList);
}
//here in message list array u can get value of checkbox which are selected.
No comments:
Post a Comment