Ver Mensaje Individual
  #4 (permalink)  
Antiguo 04/07/2008, 10:56
Avatar de angeliknlopez
angeliknlopez
 
Fecha de Ingreso: noviembre-2007
Ubicación: Manizales
Mensajes: 86
Antigüedad: 17 años, 3 meses
Puntos: 0
Respuesta: Problema con onchange

Cita:
Iniciado por foreverOdd Ver Mensaje
Hola Angelica
El atributo name puede ser el mismo para mas de un elemento del DOM.

Código PHP:
<table style="border: 1px solid black;" bgcolor=#F5F5F5 cellspacing=10 width=100%>
<tr><td><b>Proyecto: </b>
<select onchange="document.getElementById('ProyMontoValor').value=
document.getElementById('miSelect').options[document.getElementById('miSelect').selectedIndex].value;"
document.getElementById('ProyNombrer').value=
document.getElementById('miSelect').options[document.getElementById('miSelect').selectedIndex].text;"  name="A_GMonto" id='miSelect'>
<option value=0>Seleccione un Proyecto...</option>
<?php
$proy 
mysql_query("SELECT * FROM proymonto") or die("Error al seleccionar el Proyecto");
while(
$f mysql_fetch_array($proy)) {
echo 
"<option value=\"$f[ProyMontoValor]\">";
echo 
urldecode($f['ProyMontoProy']);
echo 
"</option>";
}
mysql_free_result($proy);

?>
</select>
</td></tr>
<tr><td><b>Valor del Monto ($): </b>&nbsp;
<input id="ProyNombre" type=text name="A_GMonto" readonly="readonly" size=10>
<input id="ProyMontoValor" type=text name="A_GMonto" readonly="readonly" size=10></td></tr>
trata con esto a ver
Muchas gracias, voy a ensayarlo...

Angie
__________________
ANGELICA MARIA NIETO LOPEZ
Administradora de Sistemas Informáticos
Universidad Nacional de Colombia
Sede Manizales