1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
| <script langage="JavaScript">
function Choix(form){
i = form.Glob.selectedIndex;
if (i==0){
return;
}
<?php
/*
Code pour recuperer la 2eme liste
*/
?>
switch (i){
case 1 : var txt = new Array ('collecte','support','av','supervision'); break;
case 2 : var txt = new Array ('type X75','ATM','FR','VOIP'); break;
case 3 : var txt = new Array ('degradation','inaccessibilité',' ',' '); break;
case 4 : var txt = new Array ('Divers',' ',' '); break;
case 5 : var txt = new Array ('Tel','Adr ',' ',' '); break;
case 6 : var txt = new Array ('clients','fournisseurs','administratif','compta'); break;
}
form.Type.selectedIndex = 0 ;
for(i=0;i<4;i++) {
form.Type.options[i+1].text=txt[i];
}
}
</script>
<form>
<fieldset style="width: 500px">
<legend>Liste liées</legend>
<label>Materiel</label>
<select name="Glob" onChange='Choix(this.form)'>
<option>-Choix --</option>
<? $res = mysql_query("SELECT DISTINCT global_mat FROM tableau_recap");
while($row = mysql_fetch_assoc($res)){
echo "<option value='".$row["global_mat"]."'>".$row["global_mat"]."</option>";
}
?>
</select>
<label>Type</label>
<select name="Type">
<option>Type</option>
<option></option>
<option></option>
<option></option>
<option></option>
</select>
</fieldset>
</form> |
Partager