• Domingo 29 de Septiembre de 2024, 04:18

Autor Tema:  Problena Al Pasar Info Entre Dos Paginas  (Leído 1816 veces)

oonai

  • Miembro activo
  • **
  • Mensajes: 28
    • Ver Perfil
Problena Al Pasar Info Entre Dos Paginas
« en: Jueves 4 de Agosto de 2005, 00:16 »
0
hOLA,,tengo un pequeño problema, al pasar informacion entre dos paginas,

leo una base de datso correctamente, y la despliego usando un recordset y tablas, la lista se despliega automaticamente, ella tiene un campo auto munerico que identifica el registro , unico, lo que deseo es que al tocat un boton, <for type"botton" onclick funcion()>, esta me pase a otro programa que actualiza uno de los campor desplegados, p1.asp---> manda var --> p2.asp, actualiza y regresa a p1.asp, He probado un monton de codigos y aun no logro pasas este dato, el cual se despiega correctmente en la lista. Si alguien tiene uan idea, usando el recordset , o ha realizado un programa similar, , lo agradecere. Solo me hace falt la linea de codigo que pasa e dato, lo demas funciona correctamente, Probe una simulacion usandio una variable con un dato ficticio. y funciono correctamente, solo quiero que el usuario finl haga click en un boton y este campo se actualiza solo.... gpaviles@yahoo.com GRACIAS
Si  deseas  disfrutar del arco iris, primero deberás soportar la lluvia " Dolly Parton, USA "

Kev

  • Miembro HIPER activo
  • ****
  • Mensajes: 654
    • Ver Perfil
Re: Problena Al Pasar Info Entre Dos Paginas
« Respuesta #1 en: Jueves 4 de Agosto de 2005, 00:48 »
0
Hola bueno al momento de mostrar la tabla hay un campo con un boton el cual actualizas ahora este debe ser un boton no un submit, donde al hacer OnClic mandas a una funcion Javascript que te redirecciona a la misma pagina pero esta funcion recibira una variable y mandara por GET esta variable, ahora al momento de mostrar tu tabla tambien tendrias que imprimir el ID en el evento onclic que usaras

Código: Text
  1.  
  2. &#60;input type=&#34;text&#34; onclic=&#34;Funcion(&#60;%=rs.Fields(&#34;ID&#34;)%&#62;);&#34;&#62;
  3.  
  4.  

Asi de esta manera mas o menos ahora antes de mostrar tu tabla validas una funcion si la variable se encuentra entras al codigo que actualiza luego muestras la tabla

Esa seria una posible solucion

Salu2
 :comp:
La teoria es asesinada tarde o temprano por la experiencia
Albert Einstein
Kev - 3 DCE
-----------------------------------------------------
Articulos:
Convertir texto a imagen en ASP.NET
Trabajando con el Global.asax

oonai

  • Miembro activo
  • **
  • Mensajes: 28
    • Ver Perfil
Re: Problena Al Pasar Info Entre Dos Paginas
« Respuesta #2 en: Viernes 5 de Agosto de 2005, 05:58 »
0
GRACIA. Tomare en cuenta esa sugerencia, Ahora el problema es otro, tal vez no me explique correctamente

Este es el codig del primer programa {este prograa despiega una lista de registros en una BD, cuando el cliente selecioan el boton, se va a otro programa y ejecuta modificaciones tipo update, en este registro en particular}

<br>
<%
Set conectar = Server.CreateObject("ADODB.Connection")
conectar.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("soldatos.mdb"))
set registrars=Server.createobject("ADODB.Recordset")
registrars.ActiveConnection = conectar
registrars.Source = "solicitud"
registrars.CursorType = adOpenKeySet
registrars.open
registrars.MoveFirst
do while not registrars.EOF
 if  (registrars("responsable")= "nnnn nnnnn nnnnn" ) then
%>
<table width="86%" border="0">
<tr>
<td width=4% valign="top"><%Response.Write registrars("numero")%></td>
<td width=16% valign="top"><%Response.Write registrars("fecha")%></td>
<td width=12% valign="top"><%Response.Write registrars("tiposol")%></td>
<td width=14% valign="top"><font color=red><%Response.Write registrars("estatus")%></font></td><td valign="top"><%Response.Write registrars("documento")%></td><td width=14% align="center"><form NAME="ap" METHOD="post" ACTION="solaprobar.asp"><input type="text" onclic="Funcion(<%=registrars.Fields("numero")%>);"><INPUT TYPE="hidden" name="vlink" value="solprog1.asp" ><INPUT TYPE="submit" STYLE="background:#ffffff;font-size:10px; font-family:Arial; color:#808020;" VALUE="Aprobar"></form></td>
</tr>
<table>
 <%
 end if
 registrars.movenext
 loop
 registrars.close
 conectar.close
 Set registrars = nothing
 Set conectar = nothing
%>

El otro programa , lee el ID (se llama numero), y procesa ese registro en particular, an no he probajo el codigo ue me pasastes, pero creo que tendras una mejorr vision de la idea. De antemano muchas Gracias....
Si  deseas  disfrutar del arco iris, primero deberás soportar la lluvia " Dolly Parton, USA "

oonai

  • Miembro activo
  • **
  • Mensajes: 28
    • Ver Perfil
Re: Problena Al Pasar Info Entre Dos Paginas
« Respuesta #3 en: Sábado 6 de Agosto de 2005, 18:26 »
0
Ahora te doy el codigo completo, aplique tu solucion, pero no pasa a la funcion, este es el codigo.
<HTML>
<HEAD>
<TITLE>Solicitud de documentos</TITLE>
<META HTTP-EQUIV="Content-type" CONTENT="text,html ; charset=iso-8859-1">
<META name="author" content="Guillermo Avilés Labrín - 0414.117.30.44">
<META http-equiv="Page-Exit" content="revealTrans(duration=2,Transition=6)">
<script languaje="JavaScript">
function salto() {
var resultado = confirm ('Desea imprimir su registro');
if (resultado) {
                  if (window.print)
                {
                             window.print()
                             self.location="solinicio.html";
                }
                    else
                    alert("Disculpe, su navegador no soporta esta opción.");
            }
else
self.location="solinicio.html";
}

function aprobar() {
alert("*** ERROR *** ") ;
}
</SCRIPT>
</HEAD>
<BODY bgcolor=#ffffff text="#000099" link="#ffffff" vlink="#D5F5C7" alink="#ffffff" topmargin="0" leftmargin="0">
<br>
<center>
<table border=0 width=80%>
<tr>
<td>
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
WIDTH=600 HEIGHT=125>
<PARAM NAME=movie VALUE="header.swf"> <PARAM NAME=quality VALUE=high> <PARAM NAME=bgcolor VALUE=#FFFFFF>
  <EMBED src="header.swf" quality=high bgcolor=#FFFFFF  WIDTH=600 HEIGHT=125 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED></OBJECT>
</td>
<td align=center width=20%>
<script languaje="JavaScript">
     mesarray=new Array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio","Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
     diaarray=new Array( "Domingo","Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado");
      hoy = new Date();
      dias = hoy.getDate();
      dia = hoy.getDay();
      mes = hoy.getMonth();
     mes=mesarray[mes];
      dia =diaarray[dia];
      anno = hoy.getYear();
      if (anno <200)
        anno = anno+1900;
      document.write('<TABLE WIDTH="80" height="80" BORDER="2" CELLSPAN="2"  BGCOLOR="#ffffff"><TR><TD><CENTER>');
      document.write('<FONT SIZE="2" COLOR="#202080"> <B>'+mes+'</B></FONT><br>');
      document.write('<FONT SIZE="1" COLOR="#202080">'+anno+'</FONT><br>');
      document.write('<FONT SIZE="4" COLOR="#202080" FACE="Arial"><B>'+dias+'</B></FONT><br>');
      document.write('<FONT SIZE="1" COLOR="#202080" FACE="Arial">'+dia+'</FONT><br>');
      document.write('</CENTER></TR></TD></TABLE>');
 </SCRIPT>
</tr>
<tr><td colspan=2><Hr></tr>
<tr><td colspan=2 align="center"><font color=#202080 sise=3>Documentos - Carlos Añazco</font></td></tr>
<tr><td colspan=2><Hr></tr>
</table>
<br>
<table width="86%" border="0" bgcolor="#ccffcc">
<tr>
<td width=4% align="left"><font color="#202080">ID</font></td>
<td width=16%><font color="#202080">FECHA</font></td>
<td width=12%><font color="#202080">TIPO</font></td>
<td width=14%><font color="#202080">ESTATUS</font></font></td>
<td><font color="#202080">DOCUMENTO</font></td>
</tr>
</table>
<br>
<%
 Set conectar = Server.CreateObject("ADODB.Connection")
 conectar.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("soldatos.mdb"))
 set registrars=Server.createobject("ADODB.Recordset")
 registrars.ActiveConnection = conectar
 registrars.Source = "solicitud"
 registrars.CursorType = adOpenKeySet
 registrars.open
 registrars.MoveFirst
 do while not registrars.EOF
 if  (registrars("responsable")= "Carlos Añazco" ) then
  %>
       <table width="86%" border="0">
     <tr>
     <td width=4% valign="top"><%Response.Write registrars("numero")%></td>
     <td width=16% valign="top"><%Response.Write registrars("fecha")%></td>
     <td width=12% valign="top"><%Response.Write registrars("tiposol")%></td>
     <td width=14% valign="top"><font color=red><%Response.Write registrars("estatus")%></font></td>
     <td valign="top"><%Response.Write registrars("documento")%></td>
       <td width=14% align="center"><form><input type="button" STYLE="background:#ffffff;font-size:10px; font-family:Arial; color:#808020;" VALUE="Aprobar"  onclic="aprobar(<%=registrars.Fields("numero")%>);"></form></td>
     </tr>
       </table>
 <%
 end if
 registrars.movenext
 loop
 registrars.close
 conectar.close
 Set registrars = nothing
 Set conectar = nothing
%>

<br>
<table width="86%" border="0">
<tr><td colspan=2><Hr></tr>
<table>
<form>
<INPUT TYPE="button" onclick="salto()" STYLE="background:#eeeeee;color:#855E42;" VALUE="Ir a la página principal"></center>
</form>
</body>
</html>

Agredezco cualquier respuesta
Si  deseas  disfrutar del arco iris, primero deberás soportar la lluvia " Dolly Parton, USA "