Search the Community
Showing results for tags 'display checked items'.
-
index.php <tr> <td width="125">Access Permission</td> <td width="10">:</td> <td width="175"> <form name="frmMain" action="" method="post"> <input type="text" name="txtSel" id="txtSel" style="background:#DFDFFF"> <input name="btnSelect" type="button" id="btnSelect" value="Click here ...." onClick="javascript:MM_openBrWindow('access_permission.php','pop', 'scrollbars=no,width=500,height=500,left=750')"> </form> </td> </tr> access_permission.php <script language="javascript"> function selValue() { var val = ''; for(i=1;i<=frmPopup.hdnLine.value;i++) { if(eval("frmPopup.Chk"+i+".checked")==true) { val = val + eval("frmPopup.Chk"+i+".value") + ','; } } window.opener.document.getElementById("txtSel").value = val; window.close(); } </script> <form id="frmPopup" action="" method="post" name="frmPopup"> <?php include "db_conexn.php"; if($_SESSION['designation'] == 'Manager') { $selectQuery = mysql_query("SELECT * FROM navigation"); if(mysql_num_rows($selectQuery)>0){$i=0; echo ' <tr>'; while($row = mysql_fetch_object($selectQuery)){$i++;?> <?php if(($i%2)==0){echo '</tr><tr>';}?> <div style="width:200px; float:left;"><input name="permission[]" type="checkbox" class="validate[minCheckbox[1]] checkbox" id="Chk<?=$i;?>" value="<?php echo $row->id;?>" ><span style="font-size:12px;"> <?php echo $row->name;?></span></div> <?php //if(($i%2)==0){echo ' </tr>';} } } ?> <input name="hdnLine" type="hidden" value="<?=$i;?>"> <br> <input name="btnSelect" type="button" value="Select" onClick="JavaScript:selValue();"> </form> ................................................................................................................................................. Here I can select all check box value from db, Please help me to display checked check boxes for edit page