Hola Gente del Under!
Sigo trabajando en el desarrollo de un sistema para organizar los datos de mi web.
Quisiera saber si es posible enlazar opciones de Radio Button con ComboBox. en PHP.
El códico que tengo es el siguiente:
<?php
function generaSelect()
{
include 'registrodb.php';
conectar();
$consulta=mysql_query("SELECT id, opcion FROM select1");
desconectar();
// Voy imprimiendo el primer select compuesto por los paises
echo "";
while($registro=mysql_fetch_row($consulta))
{
echo "<input type='radio' name='select1' id='select1' value='".$registro[0]."' onClick='cargaContenido(this.id)'>".$registro[1]."<br>";
}
echo "";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script type="text/javascript" src="select01.js"></script>
</head>
<body>
<form id="interes" name="interes" method="post" action="resultados.php">
<table width="300" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><p><strong>Interes: </strong></p></td>
<td><p><?php generaSelect(); ?></p></td>
</tr>
<tr>
<td><p><strong>Destino: </strong></p></td>
<td>
<?php
conectar();
$consulta=mysql_query("SELECT id, opcion FROM select2");
desconectar();
echo '<select disabled="disabled" name="select2" id="select2">
<option value="0">Selecciona opción...</option>';
while($row = mysql_fetch_array($result))
{
printf("<option></option>");
}
mysql_free_result($result);
echo '</select>';
?>
</td>
</tr>
<tr>
<td><p><strong>Plan: </strong></p></td>
<td>
<?php
conectar();
$consulta=mysql_query("SELECT id, opcion FROM select3");
desconectar();
echo '<select disabled="disabled" name="select3" id="select3">
<option value="0">Selecciona opción...</option>';
while($row = mysql_fetch_array($result))
{
printf("<option></option>");
}
mysql_free_result($result);
echo '</select>';
?>
</td>
</tr>
<tr>
<tr>
<td colspan="2">
<input type="submit" name="guardar3" id="guardar3" value="Submit" /></td>
</tr>
</table>
</form>
</body>
</html>
El código funciona muy bien cuando se trabaja solo con ComboBox, pero al modificar la primera opción a Seleccion por RadioButton, se queda.
Alguien podrÃa decirme en donde está el fallo?
Gracias y suerte.