J'ai une liste déroulante qui est alimenté via une base de donnée, si l'utilisateur selectionne MODIFICATION, un champ apparait pour qu'il entre la modif, là tous fonctionne mais mon $_POST du champ est vide enfin meme pas il est comme inexistant...
*Type de réalisation :
<select name="type_realisation" onChange="afficher1(this)">
<?php $connexion=mysql_connect("$hostname_dbprotect","$username_dbprotect","$password_dbprotect") or die("<p>Echec de connexion!");
mysql_select_db("$database_dbprotect", $connexion) or die ("<p>Echec de connexion à la base de donnée!");
$SQL4 = "SELECT id_menu,libelle,zone_texte FROM menu_deroulant WHERE id_menu='type_realisation' ORDER BY ordre";
$res4 = mysql_query($SQL4);
while ($val4=mysql_fetch_array($res4) ) {
echo "<option value=\"".$val4['zone_texte']."\">".$val4['libelle']."</option>\n";}
?>
</select>
<SCRIPT language="javascript">
<!--affiche une zone de texte si la liste déroulante est sur MODIFICATION -->
function afficher1(objet) {
if (objet.value==1) {
document.all["zone_realisation"].style.visibility="visible";
} else {
document.all["zone_realisation"].style.visibility="hidden";
}
}
</SCRIPT>
<input type="text" name="zone_realisation" id="zone_realisation" value="Préciser réf. S5" size="15" style="visibility:hidden" onChange="window.open('controle_ref.php?zone_realisation='+this.value,'ref','width=500,height=100,scrollbars=no')">
<br>
et le code de verification de la liste deroulante et recupération $_POST//Vérification champ obligatoire type de réalisation, si modification et remplit. Sinon prendre choix liste déroulante
if ($_POST["type_realisation"]) {//=="AUCUN"
echo "Veuillez saisir le champ Type de réalisation !";
} elseif ($_POST["type_realisation"]=="MODIFICATION") {
if ($_POST["zone_realisation"]=="") {
echo "Veuillez saisir une référence si vous choisissez comme \"type de réalisation\" \"MODIFICATION\" !";
} else {
$type_realisation=$_POST["zone_realisation"];
}
} else {
$type_realisation=$_POST["type_realisation"];
}
J'ai essayé de faire directement et echo $_POST["type_realisation"] et rien il passe au else direct... SOS