Ver Mensaje Individual
  #1 (permalink)  
Antiguo 11/11/2008, 21:48
denacroxis
 
Fecha de Ingreso: febrero-2004
Ubicación: sAN jUAN
Mensajes: 69
Antigüedad: 20 años, 3 meses
Puntos: 0
Combo Doble con menu????HELP

Buenas gente, tengo la siguiente duda, estoy haciendo una plantilla de presupuesto para mi local, ya tengo todo hecho y lo que me esta faltando es lol siguiente, tengo unas opciones que estan conectadas directamente a mi Base de datos donde me muestra por categoira lo que tengo en Stock, bien el problema que tengo es que cuando elijo por ejemplo Motherboard MSI k741, quiero que en la parte de precio salga seleccionada el precio que esta en la Base de datos.

Es decir creo q se llama combodoble o algo asi, es decir cuando toco en "Opcion 1Articulo", quiero que automaticamente se seleccione "Opcion 1Precio"

Les dejo el codigo que tengo hecho:

<title>PRODUCTOS</title>
<script language="javascript">
<!--
function LP_data(){
var key=window.event.keyCode;//codigo de tecla.
if (key < 48 || key > 57){//si no es numero
window.event.keyCode=0;//anula la entrada de texto.
}}
-->
</script>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
<body bgcolor="#006699" text="#FFFFFF">
<div id="Layer1" style="position:absolute; left:8px; top:13px; width:83px; height:49px; z-index:1">
<!-- Inicio codigo Dolarhoy.com -->
<a target="_blank" href="http://www.dolarhoy.com/" alt="DolarHoy" title="DolarHoy.com" >
<img src="http://www.dolaronline.com/" border="0" alt="DolarHoy.com"> </a>
<!-- Fin de Dolarhoy.com -->
</div>
<div align="center">
<p><strong><font size="5" face="Arial Black">PRODUCTOS DE VENTAS-SAN JUAN</font></strong></p>
<p>&nbsp;</p>
<p align="center"><strong><font size="4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp ;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;& nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb sp;&nbsp;&nbsp;&nbsp;&nbsp;</font></strong></p>
<p>&nbsp;</p>

</div>

<form action="Presupuesto.php" method="post"></select>
<div align="center"></div>
<table width="61%" border="1">
<tr align="center">
<td width="29%"><strong><font size="4">TIPO&nbsp;</font></strong></td>
<td width="27%"><strong><font size="4">ARTICULOS&nbsp;</font></strong></td>
<td width="22%"><strong><font size="4">PRECIO&nbsp;</font></strong></td>
<td width="22%"><strong><font size="4">CANTIDAD</font></strong></td>
</tr>
<tr>

<td><strong>MEMORIA</strong></td>
<td>
<?
//Conexion con la base
mysql_connect("localhost","root","");

//selección de la base de datos con la que vamos a trabajar
mysql_select_db("ventas");

// .................................................. ..............................................
//Creamos la sentencia SQL y la ejecutamos
$sSQL="Select articulos From ventas Where Articulos Like 'Mem%' Order By articulos ";
$result=mysql_query($sSQL);

echo '<left><select name="articulos"></left>';
$p=1;
//Generamos el menu desplegable
while ($row=mysql_fetch_array($result))
{


echo ' <option>'

."&nbsp;".$row["articulos"];}

//************************************************** **************************************************

?>
</td>
<td>
<?
$p=1;
echo '<FORM METHOD="POST" ACTION="Presupuesto.php"><br>';



//Creamos la sentencia SQL y la ejecutamos
$sSQL="Select precio From ventas Order By precio";
$result=mysql_query($sSQL);

echo '<center><select name="precio"></center>';

//Generamos el menu desplegable
while ($row=mysql_fetch_array($result))
{echo '<option>'."&nbsp;"."US$&nbsp".$row["precio"];}

?>
</td>
<td><input name="text1" type="text" onKeypress="LP_data()"> </td>
</tr>
<tr>
<td><strong>MOTHERBOARD</strong></td>
<td>

<?

// .................................................. ..............................................
//Creamos la sentencia SQL y la ejecutamos
$sSQL="Select articulos From ventas Where Articulos Like 'Mot%' Order By articulos ";
$result=mysql_query($sSQL);

echo '<left><select name="articulos2"></left>';




$p=1;
//Generamos el menu desplegable
while ($row=mysql_fetch_array($result))
{


echo '<option>'

."&nbsp;".$row["articulos"];}

//************************************************** **************************************************

?>
</td>
<td>



<?
//************************************************** ************************
$p=1;
echo '<FORM METHOD="POST" ACTION="Presupuesto.php"><br>';



//Creamos la sentencia SQL y la ejecutamos
$sSQL="Select precio From ventas Order By precio";
$result=mysql_query($sSQL);

echo '<center><select name="precio2"></center>';

//Generamos el menu desplegable
while ($row=mysql_fetch_array($result))
{echo '<option>'."&nbsp;"."US$&nbsp".$row["precio"];}
//************************************************** *******************************
?>

</td>
<td><input name="text2" type="text" onKeypress="LP_data()" ></td>
</tr>
<tr>
<td><strong>PROCESADOR</strong></td>
<td>
<?

// .................................................. ..............................................
//Creamos la sentencia SQL y la ejecutamos
$sSQL="Select articulos From ventas Where Articulos Like 'CPU%' Order By articulos ";
$result=mysql_query($sSQL);

echo '<left><select name="articulos3"></left>';




$p=1;
//Generamos el menu desplegable
while ($row=mysql_fetch_array($result))
{


echo '<option>'

."&nbsp;".$row["articulos"];}

//************************************************** **************************************************

?>
</td>
<td>


<?
//************************************************** ************************
$p=1;
echo '<FORM METHOD="POST" ACTION="Presupuesto.php"><br>';



//Creamos la sentencia SQL y la ejecutamos
$sSQL="Select precio From ventas Order By precio";
$result=mysql_query($sSQL);

echo '<center><select name="precio3"></center>';

//Generamos el menu desplegable
while ($row=mysql_fetch_array($result))
{echo '<option>'."&nbsp;"."US$&nbsp".$row["precio"];}
//************************************************** *******************************
?>
</td>
<td><input name="text3" type="text" onKeypress="LP_data()" ></td>
</tr>
<tr>
<td><strong>DISCO DURO</strong></td>
<td>
<?

// .................................................. ..............................................
//Creamos la sentencia SQL y la ejecutamos
$sSQL="Select articulos From ventas Where Articulos Like 'HD%' Order By articulos ";
$result=mysql_query($sSQL);

echo '<left><select name="articulos4"></left>';




$p=1;
//Generamos el menu desplegable
while ($row=mysql_fetch_array($result))
{


echo '<option>'

."&nbsp;".$row["articulos"];}

//************************************************** **************************************************

?>
</td>
<td>



<?
//************************************************** ************************
$p=1;
echo '<FORM METHOD="POST" ACTION="Presupuesto.php"><br>';



//Creamos la sentencia SQL y la ejecutamos
$sSQL="Select precio From ventas Order By precio";
$result=mysql_query($sSQL);

echo '<center><select name="precio4"></center>';

//Generamos el menu desplegable
while ($row=mysql_fetch_array($result))
{echo '<option>'."&nbsp;"."US$&nbsp".$row["precio"];}
//************************************************** *******************************
?>
</td>
<td><input name="text4" type="text" onKeypress="LP_data()"></td>
</tr>
</table>
<div align="left"> </div>
<div align="left"><br>
</div>
</select>
<div align="left"><br></div>
</center>
</select>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p align="center"><br>
<input type="submit" name="var" value="Presupuestar" />
</p>
<td>&nbsp; </td>
<td>&nbsp; </td>
<td>&nbsp; </td>
</form>

</div>
</BODY>
</HTML>


NO se como hacerlo, el Precio luego se envia a otro PHp que es el que imprimo para que salga el Presupuesto.

Saludos y gracias