<form>
<div id="checkboxId">\n
<input type="checkbox" name="chkBox[]" id="chkBox[]">
<input type="checkbox" name="chkBox[]" id="chkBox[]">
<input type="checkbox" name="chkBox[]" id="chkBox[]">
</div>\n
<input type="checkbox" name="selectAll" id="selectAll"
onclick="selectAllCheckbox('checkboxId', this);">
</form>
</div>
<script language="javascript" src="jquery.js"
type="text/javascript">
</script>
<script language="javascript">
function selectAllCheckbox(divname, obj)
{
if (obj.checked)
{\n
$"#" + divname + " input[type='checkbox']").attr('checked', true);
}
else
{
$("#" + divname + " input[type='checkbox']").attr('checked', false);
}
}
</script>
No comments:
Post a Comment