0 like 0 dislike
72 views
in Education & Reference by (160 points)

1 Answer

1 like 0 dislike
by (50 points)
<script type="text/javascript">
function myfunction(counter) {
    var a=document.getElementById("tbl");
	  if ( a.hasChildNodes() ){
        while ( a.childNodes.length >= 1 )
            {
            a.removeChild( a.firstChild );       
            } 
        }
		 var row1=document.createElement("TR");
        a.appendChild(row1);
   
            var col4=document.createElement("TD"); 
            row1.appendChild(col4);
            col4.setAttribute("class","heading");
            $(".heading").html("cidMember");
			var col5=document.createElement("TD"); 
            row1.appendChild(col5);
            col5.setAttribute("class","heading1");
            $(".heading1").html("select");
			
    
    for (var i=1;i<=counter;i++) {
var num = i;
var num = num < 10 ? "0"+num : num;
        var row=document.createElement("TR");
        a.appendChild(row);
   
            var col1=document.createElement("TD"); 
            row.appendChild(col1);
            col1.setAttribute("class","column"+i);
            $(".column"+i).html("<?php echo $_GET[cid]?>"+num);
			
			var col2=document.createElement("TD"); 
            row.appendChild(col2);
            col2.setAttribute("class","colmn"+i);
            $(".colmn"+i).html('<input type="checkbox" value="<?php echo $_GET[cid]?>'+num+'" name="check'+i+'"  checked>');
			
			
       
    }
       
    }

HTML

<font size="+1">how many checkbox you want</font>
           <select id="exten" onchange="myfunction(this.value)">
               
<?php 
for ($i = 1; $i <26; $i++) {
    $num = $i;
    $num = $num < 10 ? "0$num" : $num;
?>
<option value="<?php echo $num;?>"><?php echo $num;?></option>
<?php } ?>
</select>

Related questions

0 like 0 dislike
2 answers 136 views
2 like 0 dislike
1 answer 101 views
0 like 0 dislike
2 answers 1.9k views
0 like 0 dislike
1 answer 187 views
1 like 0 dislike
1 answer 1.1k views
0 like 0 dislike
1 answer 77 views
0 like 0 dislike
1 answer 2.2k views
0 like 0 dislike
1 answer 83 views
1 like 0 dislike
2 answers 2.8k views
...