Bonjour a tous
Voila mon probleme :
J'ai un formulaire dans une popup avec une liste deroulante(pour selectionner une personne)
Pour remplir la liste je fais appel a une fonction :
affichelistetech2($codetechnicien,"codetechnicien",1);
A la base dans ma liste je suis sur la valeur "A definir".
En changeant cette valeur (cad selectionner une personne dans ma liste)
je voudrait que ca ouvre automatiquement une autre popup (validation.php) me confirmant que le technicien selectionne est : '$nom'
code de la fonction :
///////////////
function affichelistetech2($codetechnicien,$nom,$allowempty) {
$query="SELECT codetechnicien,nom FROM techniciens where nom!='CLIENT' ORDER by nom";
$req=mysql_query($query);
?>
<form name="validation" ACTION="validation.php" METHOD="POST">
<select name='$nom' onChange="window.open('popup.php?page=validation&codetechnicien=$codetechnicien&referrant=$PAGEURLENC','Confirmation','width=500,height=305')">";
<?
if($allowempty!=0)
echo "<option value=\"\"></option>";
while($line = mysql_fetch_array($req)) {
$tmpcode=$line["codetechnicien"];
$tmpnom=$line["nom"];
echo "<option";
if($codetechnicien==$tmpcode) {
echo " selected";
}
printf(" value =\"%d\">%s</option>\n",$tmpcode,$tmpnom);
}
echo "</select>\n";
echo "</form>";
}
////////////////////////
avec l'attribut onchange ca marche nickel la popup s'ouvre mais je recupere toujours l'ancienne valeur de ma liste deroulante 'A definir'
code validation.php
/////////////////////
<?
$query = "SELECT nom FROM techniciens where codetechnicien=$codetechnicient";
$req = mysql_query($query);
$line = mysql_fetch_array($req);
$nom = $line ["nom"];
echo "Technicien associé : <b>$nom</b><br>\n";
//////////////
?>
En faite la variable $codetechnicien ne s'actualise pas elle est toujours a la valeur initiale
Comment je peut faire pour recup le bon nom de personne en fonction de son code ????
Merci
Atomik29
