Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////Code for obtaining and displaying Checkbox list
- <div id="exxx">
- <fieldset><legend>Select Export Fields</legend>
- <?php
- $result=mysql_query("desc student_test",$conn);
- echo '<ul id="unshund">';
- while($row=mysql_fetch_array($result))
- {
- $val=$row['Field'];
- ?>
- <script language="JavaScript">
- $(function(){
- $("#chkAll").change(function(){
- if (this.checked == true) {
- $("input:checkbox.child").attr("checked", "checked");
- }
- else {
- $("input:checkbox.child").removeAttr("checked");
- }
- });
- });
- </script>
- <li ><input type='checkbox' class="child" name='' id=<?php echo $val; ?> value=<?php echo $val; ?> onchange="javascript:selectedField(this.id)" <?php if(isset($_SESSION['selectedFields'][$val])) { echo 'checked="checked"';} ?> /> <?php echo ucfirst($row['Field']);?> </li>
- <?php
- }
- echo '</ul>';
- ?>
- <input type="checkbox" id="chkAll" /> Toggle All<br/>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement