Código PHP:
<head>
<script language="JavaScript">
function recarga(form)
{
form.submit();
}
</script>
</head>
<body>
<h2 align="center">Resultado Beneficios</h2>
<form name="beneficios" action="graba.php" method="post">
<table width="69%" border="1">
<td><input name="di_rut" type="text" size="12">
-
<input name="dg_digito_verificador" type="text" size="5"> </td>
</tr>
<tr>
<td><b>Nombre</b></td>
<td><input name="nombre" type="text" size="50"> </td>
</tr>
<tr>
<td><strong>Beneficio</strong></td>
<td>
<?
include ("encabezado.php");
$sSQL="SELECT cod_tipo_benef, tipo_benef FROM t_Tipo_Benef ORDER BY cod_tipo_benef";
$result=mysql_db_query($db,$sSQL);
echo '<select name="beneficio" onChange="javascript:recarga(this.form);">';
echo "<option>-- Seleccione el beneficio--</option>";
while ($row=mysql_fetch_array($result))
{
if ($row['cod_tipo_benef'] == $beneficio)
{ echo "<option value='".$row['cod_tipo_benef']."' selected>".$row['tipo_benef']."</option>";
}
else
{ echo "<option value='".$row['cod_tipo_benef']."'>".$row['tipo_benef']."</option>";
}
}
echo "</select>";
?>
</td>
</tr>
<tr>
<td><strong>Detalle</strong></td>
<td>
<?
$sSQL2="SELECT cod_sub_benef, detalle From t_Sub_Benef WHERE cod_tipo_benef='$beneficio'";
$result=mysql_db_query($db,$sSQL2);
echo '<select name="sub_beneficio" onChange="javascript:recarga(this.form);">';
echo "<option>-- sub_beneficio--</option>";
while ($row=mysql_fetch_array($result))
{
if ($row['cod_sub_benef'] == $sub_beneficio)
{ echo "<option value='".$row['cod_sub_benef']."' selected>".$row['detalle']."</option>";
}
else
{ echo "<option value='".$row['cod_sub_benef']."'>".$row['detalle']."</option>";
}
}
echo "</select>";
?>
</table>
<p><input name="boton1" type="submit" value="Ingresar"> <INPUT TYPE="reset" VALUE=" Limpiar">
</form>
el html no lo puse en etiqueta
Ojala me puedan ayudar para salir de este cachito rapido...gracias!