Ver Mensaje Individual
  #2 (permalink)  
Antiguo 03/09/2009, 08:34
Pelao
 
Fecha de Ingreso: abril-2003
Mensajes: 260
Antigüedad: 21 años, 1 mes
Puntos: 1
Respuesta: Lista desplegable + textarea relacion

lo resolvi con esto!

Código HTML:
<html>
<head>
<title>Pregunta en lista desplegable, respuesta en área de texto</title>
</head>

<body>

<p align="center"><b>Pregunta en lista desplegable, respuesta en área de texto</b>
</p>
<table border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%">
    <form name="ddmessage">
      <table border="0" width="100%" cellspacing="0" cellpadding="0">
        <tr>
          <td width="100%">
          <select name="selectbox" size="1" onChange="changecontent(this)">
          <option selected value="Pregunta número 1">Pregunta número 1</option>
          <option value="Respuesta número 2">Pregunta número 2</option>
          <option value="Respuesta número 3">Pregunta número 3</option>
          <option value="Respuesta número 4">Pregunta número 4</option>
          </select><br>
          </td>
        </tr>
        <tr>
          <td width="100%">
          <textarea rows="8" name="contentbox" cols="35" wrap="virtual"></textarea><br>
&nbsp;</td>
        </tr>
      </table>
    </form>
    </td>
  </tr>
</table>
<p>
<script language="JavaScript">

/*
Drop down messages script
By Website Abstraction (http://wsabstract.com)
Over 400+ free scripts here!
*/

//change contents of message box, where the first one corresponds with the first drop down box, second with second box etc
var thecontents=new Array()

thecontents[0]='Respuesta número 1'

thecontents[1]='Respuesta número 2'

thecontents[2]='Respuesta número 3'

thecontents[3]='Respuesta número 43333'


//don't edit pass this line

function changecontent(which){
document.ddmessage.contentbox.value=thecontents[which.selectedIndex]
}

document.ddmessage.contentbox.value=thecontents[document.ddmessage.selectbox.selectedIndex]
</script>

</body>
</p>

</body>

</html> 
__________________
Bye!