Hello,
I want to get checkbox depending on choice dropdown list.
this is my code
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" media="all" charset="utf-8"/>
<title>APPLICATION</title>
<script type="text/javascript">
function changerub(rubrique){
var divIds= new array('agent');
for(var i=0; i<divIds.length;i++){
document.getElementById(divIds[i]).style.display = (i==rubrique)?'block':'none';
}
}
</script>
</head>
<body>
<?php
$cnx=mysql_connect('localhost','root','') or die ("Erreur de connexion");
mysql_select_db('saher',$cnx);
?>
<form method="post" action="" id="form_1" >
<table border=0 align=center width="100%" cellpadding='3' cellspacing='2'>
<tr>
<th colspan=4>FILTER</th>
</tr>
<tr>
<th>Sensor</th>
<td>
<div id="agent" style="display:none">
<?php
$sig_name=mysql_query("SELECT DISTINCT abreviation,adresse FROM agent");
$rows=mysql_num_rows($sig_name);
$cols=mysql_num_fields($sig_name);
for ($i=0;$i<$rows;$i++)
{
echo '<input name="checkbox[]" type="checkbox" id="checkbox[]" value="'.mysql_result($sig_name,$i,0).'">';
echo mysql_result($sig_name,$i,0);
}
?>
</div>
</td>
<th>ISP</th>
<td >
<select name="isp" value="isp" onChange="changerub(form_1.isp.selectedIndex);">
<option value="0" selected="selected" >ALL</option>
<?php
$isp_name=mysql_query("SELECT DISTINCT nom_fsi FROM fsi order by nom_fsi asc");
while($data=mysql_fetch_array($isp_name))
{
echo "<option>".$data["nom_fsi"]."</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td colspan=4>
<input type="submit" value="Valider" name="filter" />
<input type="submit" value="Generate report" name="report" onClick="openReport('form_1','tcpdf/report2.php')">
</td>
</tr>
</table>
</form>
<center>
</body>
</html>