Ver Mensaje Individual
  #6 (permalink)  
Antiguo 14/03/2012, 19:49
Avatar de emprear
emprear
Colaborador
 
Fecha de Ingreso: junio-2007
Ubicación: me mudé
Mensajes: 8.388
Antigüedad: 16 años, 10 meses
Puntos: 1567
Respuesta: Listas en html con php / mysql

Javascript te va a trabajar sobre el html resultante

Ejemplo
Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <title>onchange en select y split + innerHTML</title>
  5. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  6. <!-- http://www.forosdelweb.com/f4/listas-html-con-php-mysql-981718/ -->
  7. <script type="text/javascript">
  8. //<![CDATA[
  9. function propiedades_carne(){
  10. var cortes = document.getElementById('carnes').value;
  11. if(cortes != ""){
  12. var valores = cortes.split('|');
  13. var corte = valores[0];
  14. var grasa = valores[1];
  15. var precio = valores[2];
  16. alert('corte: ' + corte +' - grasa:' + grasa + '% - precio: $' + precio);
  17. }
  18. }
  19. //]]>
  20. </head>
  21. <select id="carnes" onchange="propiedades_carne();">
  22. <option value="">Seleccione una variedad</option>
  23. <option value="Vacio|30|60">Vacio</option>
  24. <option value="Mollejas|60|40">Mollejas</option>
  25. </body>
  26. </html>

Para el resto, buscá como pasar los valores obtenidos a algun elemento de la página (div, span, u otro)

http://librosweb.es , hay un muy buen manual de javascript

Saludos
__________________
La voz de las antenas va, sustituyendo a Dios.
Cuando finalice la mutación, nueva edad media habrá
S.R.