PHP Code:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#Lessons').change(function(){
var lesNum = $('#Lessons').val();
$(".xyz").css("display", "none");
for(var k=0; k < lesNum; ++k){
$(".xyz").eq(k).css("display", "block");
}
});
$('#Lessons').trigger('change');
});
</script>
</head>
<body>
<!-- and my table code is here -->
Number of Lessons to Show: <select id="Lessons" name="Lessons">
<?php for($j=1;$j<=5;$j++):?>
<option value="<?php echo $j;?>"><?php echo $j;?></option>
<?php endfor; ?>
</select>
<?php for($j=1;$j<=5;$j++):?>
<div class="xyz" style="display:none;">
<table>
<tr>
<td>//some table data for table #<?php echo $j; ?> goes here.</td>
</tr>
</table>
</div>
<?php endfor; ?>
</body>
</html>
Bookmarks