J'ai de plus en plus de mal avec le Javascrip.
je vais te donner tout mon code soucrce:
Je voudrais que le 1er élément (<OPTION VALUE="">Choisir une option</option>) d'un formulaire ne pas réagi si on clique dessu, mais que les autres reagissent (ceux issu de la base de donner)
PS: A ce stade tout marche ,sof les 1er élément des formulaires sont sélectionnable.
Je voudrais aussi des onchange au lieu des boutons si possible .
Merci beaucoup pour ton aide.
____________________________________________________________
[sources]
head>
<title>Form</title>
</head>
<body>
<body background="../ima/font2.jpg">
<BR><BR><BR>
<UL type="square">
<form action = "Treatmentform91a.php" method="post">
<LI><B><FONT color="#003366" size=4>Site:</FONT></B> <SELECT name="site"> </LI>
<OPTION VALUE="">Choisir une option</option>
<?php
// connection DB
$base = mysql_connect ('***', '***', '***')
or die("Unable to connect to server $server");
mysql_select_db ('***', $base)
or die("Unable to connect to DB $base");
$sql = "SELECT DISTINCT site FROM SITES;" ;
//We run the motion (mysql_query), and it imposes an error message if the request does not go well (or die)
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
// It will scan all tuples one by one
while ($data = mysql_fetch_array($req)) {
// on affiche les résultats
echo '<OPTION VALUE="'.$data['site'].'">'.$data['site'].'</option><br />';
}
mysql_free_result ($req);
mysql_close ();
?>
</SELECT>
<input type = "submit" value = "Send"></form>
</UL>
<UL type="square">
<form action = "Treatmentform91b.php" method="post">
<LI><B><FONT color="#003366" size=4>manufactures:</FONT></B> <SELECT NAME="fab"></LI>
<OPTION VALUE="">Choisir une option</option>
<?php
// connection DB
$base = mysql_connect ('***', '***', '***')
or die("Unable to connect to server $server");
mysql_select_db ('***', $base)
or die("Unable to connect to DB $base");
$sql = "SELECT DISTINCT fabbricati FROM FABBRICATI;" ;
//We run the motion (mysql_query), and it imposes an error message if the request does not go well (or die)
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
// It will scan all tuples one by one
while ($data = mysql_fetch_array($req)) {
// on affiche les résultats
echo '<OPTION VALUE="'.$data['fabbricati'].'">'.$data['fabbricati'].'</option><br />';
}
mysql_free_result ($req);
mysql_close ();
?>
</SELECT>
<input type = "submit" value = "Send"></form>
</UL>
<UL type="square">
<form action = "Treatmentform91c.php" method="post">
<LI><B><FONT color="#003366" size=4>local technical:</FONT></B> <SELECT NAME="LT"></LI>
<OPTION VALUE="">Choisir une option</option>
<?php
// connection DB
$base = mysql_connect ('***', '***', '****')
or die("Unable to connect to server $server");
mysql_select_db ('***', $base)
or die("Unable to connect to DB $base");
$sql = "SELECT DISTINCT localitecnici FROM LOCALITECNICI;" ;
//We run the motion (mysql_query), and it imposes an error message if the request does not go well (or die)
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
// It will scan all tuples one by one
while ($data = mysql_fetch_array($req)) {
// on affiche les résultats
echo '<OPTION VALUE="'.$data['localitecnici'].'">'.$data['localitecnici'].'</option><br />';
}
mysql_free_result ($req);
mysql_close ();
?>
</SELECT>
<input type = "submit" value = "Send"></form>
</UL>
<br><br>
<input type="button" value="back" onClick="javascript:location.href='./Queriesmenu.htm'" />
</form>
</body>
</html>
[/sources]________________________________________________________