<script language="JavaScript"><br /><!-- <!-- Begin function CheckAll(chk) { for (i = 0; i < checked =" true" i =" 0;" checked =" false"><br /></script>
This is the HTML code to be kept inside the body tag.
<form name="myform" action="checkboxes.asp" method="post">
<b>Scripts for Web design and programming</b>
<input name="check_list" value="1" type="checkbox">ASP
<input name="check_list" value="2" type="checkbox">PHP
<input name="check_list" value="3" type="checkbox">JavaScript
<input name="check_list" value="4" type="checkbox">HTML
<input name="check_list" value="5" type="checkbox">MySQL
<input name="Check_All" value="Check All" onclick="CheckAll(document.myform.check_list)" type="button">
<input name="Un_CheckAll" value="Uncheck All" onclick="UnCheckAll(document.myform.check_list)" type="button">
For PHP code to get check box's value
if ( isset($_POST['Submit']) ) {
$postCount = count($_POST['check_list']);
for ( $i=0; $i < $postCount; $i++ ) {
$deleteIds .= $_POST['check_list'][$i].',';
}</form>
No comments:
Post a Comment