Ver Mensaje Individual
  #4 (permalink)  
Antiguo 16/04/2013, 07:34
Avatar de tquezada
tquezada
 
Fecha de Ingreso: febrero-2013
Ubicación: Santiago
Mensajes: 196
Antigüedad: 11 años, 2 meses
Puntos: 8
Respuesta: desplegar textarea desde un combobox

ya lo solucione era con javascript!
Código Javascript:
Ver original
  1. <script type="text/javascript">
  2. var ver
  3. function mostrar(num) {
  4.   obj = document.getElementById('c'+(num+1));
  5.   ver.style.display = 'none';
  6.   obj.style.display = 'block';
  7.   ver = obj;
  8. }
  9. </script>

Código HTML:
Ver original
  1. <body onload = "ver=document.getElementById('c1')">
  2. <td>Tipo de Deporte</td>
  3.     <td>
  4.     <select name="select" id="select" onchange="mostrar(this.selectedIndex)">
  5.     <option value="1">Seleccione</option>
  6.     <option value="1">Baby-Futbol</option>
  7.     <option value="2">Tenis</option>
  8.     <option value="3">Aerobica</option>
  9.     <option value="4">Otro</option>
  10.     </select>
  11.     </td>
  12.   </tr>
  13.   <tr>
  14.     <td valign="top">Integrantes</td>
  15.     <td>
  16.     <div id="c1"><input type="text" name="" /></div>
  17. <div id="c2" style="display:none">
  18. <input type="text" name="futbol1" /><br />
  19. <input type="text" name="futbol2" /><br />
  20. <input type="text" name="futbol3" /><br />
  21. <input type="text" name="futbol4" /><br />
  22. <input type="text" name="futbol5" /><br />
  23. <input type="text" name="futbol6" /><br />
  24. <input type="text" name="futbol7" /><br />
  25. <input type="text" name="futbol8" /><br />
  26. <input type="text" name="futbol9" /><br />
  27. <input type="text" name="futbol10" /><br />
  28. </div>
  29. <div id="c3" style="display:none">
  30. <input type="text" name="tenis1" /><br />
  31. <input type="text" name="tenis1" /><br />
  32. <input type="text" name="tenis1" /><br />
  33. <input type="text" name="tenis1" /><br />
  34. </div>
  35. <div id="c4" style="display:none">
  36. <input type="text" name="aerobica1" /><br />
  37. <input type="text" name="aerobica1" /><br />
  38. <input type="text" name="aerobica1" /><br />
  39. <input type="text" name="aerobica1" /><br />
  40. <input type="text" name="aerobica1" /><br />
  41. </div>
  42. <div id="c5" style="display:none">
  43. <input type="text" name="otro1" /><br />
  44. <input type="text" name="otro2" /><br />
  45. <input type="text" name="otro3" /><br />
  46. <input type="text" name="otro3" /><br />
  47. <input type="text" name="otro4" /><br />
  48. </div>
  49.     </td>
  50.   </tr>
__________________
¿Sabes cuántos programadores hacen falta para cambiar una bombilla? - no, no ¿Cuántos? - Ninguno... es un problema de hardware.