Ver Mensaje Individual
  #7 (permalink)  
Antiguo 26/10/2011, 14:36
Sirrohan
 
Fecha de Ingreso: julio-2010
Mensajes: 275
Antigüedad: 13 años, 10 meses
Puntos: 21
Respuesta: enviar selección de un combo a textbox con un boton

Código HTML:
Ver original
  1. <title>Documento sin título</title>
  2. <script language="javascript">
  3. function funcion(combo1)
  4. {
  5.        document.getElementById('marcas').value=combo1;
  6. }
  7.  
  8. </head>
  9.  
  10.  
  11.  
  12. <form action="" name="formularito">
  13. <table width="250" border="1">
  14.   <tr>
  15.     <td>
  16.       <select name="combo1" size="1" id="combo1" onchange= "javascript:funcion(combo1.value)">
  17.       <option value="adidas">ADIDAS</option>
  18.       <option value="nike">NIKE</option>
  19.       <option value="umbro">UMBRO</option>
  20.       <option value="diadora">DIADORA</option>
  21.       <option value="fila">FILA</option>
  22.       </select>
  23.     </td>
  24.   </tr>
  25.   <tr>
  26.     <td>
  27.     <input type="text" name="combito" id="marcas" size="5"  />
  28.     </td>
  29.   </tr>
  30.   <tr>
  31.     <td>
  32.     <input  type="button" value="shit" onclick="document.getElementById('marcas').value=document.getElementById('combo1').value">
  33.     </td>
  34.   </tr>
  35. </form>
  36.  
  37. </body>

Sugería que cambiaras el select de esta forma