A ver si alguien sabría decirme el porque de que este código no funciona... recibo sin problemas la variable $_POST['nombre'] pero la variable $_POST['dato'] que es generada dinámicamente me es imposible...
Os pasteo el código:
Código HTML:
<html>
<head>
<title>Demo</title>
</head>
<body>
<?
if(isset($_POST['nombre']))
{
echo "<br>El nombre:" . $_POST['nombre'];
}
if(isset($_POST['dato']))
{
echo "<br>El dato:" . $_POST['dato'];
}
?>
<script language="JavaScript">
var Informacion_GeneralArray;
Informacion_GeneralArray=["General","Configuracion","Prueba1"];
function ValoresGeneral(v, capa) {
// el tratamiento en sí...
var NomArray = eval(v + "_GeneralArray");
var str = '<SELECT name="dato" class="edit">';
str += '<OPTION value="" SELECTED>[ Valores ]</OPTION>';
for (x=0;x < NomArray.length;x++){
str+='<OPTION value="'+NomArray[x]+'">'+NomArray[x]+'</OPTION>';
}
str += '</SELECT>';
document.getElementById(capa).innerHTML = str;
}
</script>
<table width="400" align="center">
<form action="prueba.php" name="modgeneral1" method="post">
<tr>
<td>
<select name="nombre" class="edit" onchange="ValoresGeneral(this.value,'valoresgeneral');">
<option value=""></option>
<option value="Informacion">Informacion</option>
</select>
</td>
<td>
<div id="valoresgeneral"></div>
</td>
<td width="32" align="center"><a href="javascript:document.modgeneral1.submit();">Nuevo</a></td>
</tr>
</form>
</table>
</body>
</html>
Gracias y un saludo.