
03/07/2004, 05:33
|
|
Mostrar en textarea contenido de combobox Necesito que segun el usuario pinche en uno de las opciones del combo (campo Fecha), se muestre el contenido del campo Noticia en el textarea. A ver si alguien puede ayudarme.
<%
Dim conexion, rs, sql
set conexion=Server.CreateObject("ADODB.Connection")
conexion.open "Provider=Microsoft.jet.oledb.4.0; Data source="&Server.MapPath("../db/db1.mdb")
set rs=Server.CreateObject("ADODB.Recordset")
sql="SELECT * FROM noticias ORDER BY Fecha DESC"
set rs=conexion.execute(sql)
%>
<form action="" method="post" name="noticias_mod" id="noticias_mod">
<table width="100%" border="0" cellspacing="10">
<tr>
<td><select name="FechaNoticia" id="FechaNoticia" onChange="window.location=this.value">
<option>Elige una noticia</option>
<% while not rs.eof %>
<option value="copia de _admin_n_mod.asp?id=<%=rs.fields("Id")%>"><%=rs("F echa")%></option>
<% rs.movenext
wend %>
</select></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>
<%
'CONCERNIENTE A LA SELECCION
Dim rs2, IdSql, Codigo
set rs2=Server.CreateObject("ADODB.Recordset")
Codigo=Request.QueryString("id")
IdSql="SELECT Noticia FROM noticias WHERE Id=id"
set rs2=conexion.execute(IdSql)
%>
<textarea name="TextoNoticia" cols="35" rows="5" wrap="virtual" id="TextoNoticia"><%=Codigo%><%=rs2("Noticia")%></textarea></td>
</tr>
<tr>
<td> </td>
<td align="right"> <input type="submit" name="Submit" value="Modificar noticia">
<input type="submit" name="Submit2" value="Eliminar noticia">
</td>
</tr>
</table>
</form> |