Foros del Web » Programando para Internet » ASP Clásico »

Pasar datos de input=hydden Urgente

Estas en el tema de Pasar datos de input=hydden Urgente en el foro de ASP Clásico en Foros del Web. Hola maestros del ASP Tengo un problema para guardar los valores de un datos, les explico, resulta que llamo a Productos, pero solo muestro el ...
  #1 (permalink)  
Antiguo 14/07/2003, 14:23
Avatar de Rriveros  
Fecha de Ingreso: noviembre-2002
Ubicación: Santiago
Mensajes: 214
Antigüedad: 21 años, 7 meses
Puntos: 0
Pasar datos de input=hydden Urgente

Hola maestros del ASP
Tengo un problema para guardar los valores de un datos, les explico, resulta que llamo a Productos, pero solo muestro el codigo y la descripcion, recojo esos valores desde el select, eso funciona bien, pero el Valor $$$ como tal del producto lo dejo en input=hydden, pero no puedo guardarlo en mi BD.
Espero me haya explicado bien y me puedan ayudar
Aca va el codigo

Ingreso_Orden_Trabajo.asp

<html>
<head>
<title>Intranet O.T.</title>
</head>
<body>
<p><img src="banner.jpg" width="794" height="123"></p>
<p>Fecha Actual <%=Date%> </p>
<p>&nbsp;</p>
<form action="procesar4.asp" method="post">
<table border="0" cellpadding="0" cellspacing="0" style="BORDER-COLLAPSE: collapse" bordercolor="#111111" width="80%" id="AutoNumber1">
<tr>
<TD align=middle></TD>
<td width="100%" colspan="4" align="middle"><b><font face="Tahoma">Ingreso Orden de Trabajo</font></b></td>
</tr>
<tr>
<td width="25%" align="middle">&nbsp;</td>
<td width="25%" align="middle">&nbsp;</td>
<td width="25%" align="middle">&nbsp;</td>
<td width="25%" align="middle">&nbsp;</td>
</tr>
<tr>
<td width="25%"><font face="Tahoma">Fecha</font></td>
<td width="25%"><font face="Tahoma"><input name="Fecha" size="10" ></font></td>
<td width="25%">&nbsp;</td>
<td width="25%">&nbsp;</td>
</tr>
<tr>
<td width="25%"><font face="Tahoma">Número de Orden</font></td>
<td width="50%" colspan="2"><font face="Tahoma"><input name="Nro_Orden" size ="10"></font></td>
<td width="25%">&nbsp;</td>
</tr>
<tr>
<td width="25%"><font face="Tahoma">Cliente</font></td>
<td width="40%"> <%
Dim oConn,strSQL, objRS, strSQL2, objRS2, strSQL3, objRS3, strSQL4, objRS4
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("Servicios.mdb"))
strSQL = "SELECT Empresa, Telefono FROM Clientes"
strSQL2 = "SELECT Cod_Producto, Descripcion, Neto FROM Productos"
strSQL3 = "SELECT Cod_Producto, Descripcion, Neto FROM Productos"
strSQL4 = "SELECT Cod_Producto, Descripcion, Neto FROM Productos"
Set objRS = oConn.Execute(strSQL)
Set objRS2 = oConn.Execute(strSQL2)
Set objRS3 = oConn.Execute(strSQL3)
Set objRS4 = oConn.Execute(strSQL4)

%>
<select name="Empresa">
<option>Seleccione...</option>
<%
Do While not objRS.eof%>
<option><%=objRS("Empresa")%>
&nbsp;&nbsp;&nbsp;Teléfono &nbsp;<%=objRS("Telefono")%>
</option>

<% objRS.movenext
Loop
%>

</td>
<td width="25%">&nbsp;</td>
<td width="25%">&nbsp;</td>
</tr>
<TR>
<TD width="25%"><FONT face=Tahoma>Descripción Problema</FONT></TD>
<TD width="50%" colSpan=2><INPUT style="WIDTH: 342px; HEIGHT: 54px"
size=44 name=Descripcion_Problema></TD>
<TD width="25%"></TD></TR>
<TR>
<TD width="25%"><FONT face=Tahoma>Informe</FONT></TD>
<TD width="50%" colSpan=2><INPUT style="WIDTH: 342px; HEIGHT: 57px"
size=44 name=informe></TD>
<TD width="25%"></TD></TR>
<tr>
<td width="25%"><font face="Tahoma">Código Producto 1</font></td>
<td width="50%" colspan="2">
<font face="Tahoma">
<select name="Cod_Producto1">
<option>Seleccione...</option>
<%
Do While not objRS2.eof%>
<option><%=objRS2("Cod_Producto")%>
&nbsp;&nbsp;&nbsp;Descripción&nbsp;
<%=objRS2("Descripcion")%>
<% objRS2.movenext
Loop
%>
</select></font></td>
<input=hydden name=Valor_Prod1 value="<%=Neto%>">
<tr>
<td width="25%"><font face="Tahoma">Código Producto 2</font></td>
<td width="50%" colspan="2">
<font face="Tahoma">
<select name="Cod_Producto2">
<option>Seleccione...</option>
<%
Do While not objRS3.eof%>
<option><%=objRS3("Cod_Producto")%>
&nbsp;&nbsp;&nbsp;Descripción&nbsp;
<%=objRS3("Descripcion")%>

<% objRS3.movenext
Loop
%>
</select></font></td>
<input=hydden name=Valor_Prod2 value="<%=Neto%>">
<tr>
<td width="25%"><font face="Tahoma">Código Producto 3</font></td>
<td width="50%" colspan="2">
<font face="Tahoma">
<select name="Cod_Producto3">
<option>Seleccione...</option>
<%
Do While not objRS4.eof%>
<option><%=objRS4("Cod_Producto")%>
&nbsp;&nbsp;&nbsp;Descripción&nbsp;
<%=objRS4("Descripcion")%>

<% objRS4.movenext
Loop
%>
</select></font></td>
<input=hydden name=Valor_Prod3 value="<%=Neto%>">
<td width="25%">&nbsp;</td>
</tr>
<tr>
<td width="25%"><font face="Tahoma">Valor Prestación</font></td>
<td width="25%"><font face="Tahoma"><input name="Valor_Prestacion" size="10" ></font></td>
<td width="25%">&nbsp;</td>
<td width="25%">&nbsp;</td>
</tr>
<tr>
<td width="25%"><font face="Tahoma">Tipo</font></td>
<td width="25%"><font face="Tahoma"><select size="1" name="Tipo">
<option value="Garantia">Garantía</option>
<option selected value="Reparacion">Reparación</option>
</select></font></td>
<td width="25%">&nbsp;</td>
<td width="25%">&nbsp;</td>
</tr>
<tr>
<td width="25%"><font face="Tahoma">Contacto</font></td>
<td width="25%"><font face="Tahoma"><input name="Contacto" size=44>
</font></td>
<td width="25%">&nbsp;</td>
<td width="25%">&nbsp;</td>
</tr>

<%
If request.form() <> "" then
V1 = Request.Form("Valor_Prod1")
V2 = Request.Form("Valor_Prod2")
V3 = Request.Form("Valor_Prod3")
V4 = Request.Form("Valor_Prestacion")
Total = V1 + V2 + V3 + V4
Total_OT1 = Request.Form(" & Total &")
End if
%>
<input=hydden name=Total_OT value="<%=Total%>">
<%=request.form("Total")%>
</table>
<INPUT TYPE="submit" VALUE="Grabar">
</form>
<p align=center><A href="menu.htm">Volver a Menú Principal</a></p>
</body>
</html>



Este es el que procesa

<%
Dim oConn,strSQL', strSQL2
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open("DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("Servicios.mdb"))
strSQL = "insert into Orden_Trabajo (Nro_Orden, Empresa, Descripcion_problema, informe, Cod_Producto1, Cod_Producto2, Cod_Producto3, Valor_Prestacion, Fecha, Tipo, Contacto) values ('" & Request.Form("Nro_Orden") & "','" & Request.Form("Empresa") & "','" & Request.Form("Descripcion_Problema") & "','" & Request.Form("informe") & "','" & Request.Form("Cod_Producto1") & "','" & Request.Form("Cod_Producto2") & "','" & Request.Form("Cod_Producto3") & "','" & Request.Form("Valor_Prestacion") & "','" & Request.Form("Fecha") & "','" & Request.Form("Tipo") & "','" & Request.Form("Contacto") & "')"
'strSQL = "insert into Orden_Trabajo (Nro_Orden, Empresa, Descripcion_problema, informe, Cod_Producto1, Cod_Producto2, Cod_Producto3, Valor_Prod1) values ('" & Request.Form("Nro_Orden") & "','" & Request.Form("Empresa") & "','" & Request.Form("Descripcion_Problema") & "','" & Request.Form("informe") & "','" & Request.Form("Cod_Producto1") & "','" & Request.Form("Cod_Producto2") & "','" & Request.Form("Cod_Producto3") & "','" & Request.Form("Valor_Prod1") & "')"
oConn.Execute(strSQL)
oConn.Close
set oConn = nothing
Response.Redirect("ingreso_orden_trabajo.asp")
%>
__________________
www.nelhost.net
  #2 (permalink)  
Antiguo 14/07/2003, 14:35
Avatar de Saruman  
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 21 años
Puntos: 5
oye disculpa, pero para que es un input=hydden
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.
  #3 (permalink)  
Antiguo 14/07/2003, 14:36
Avatar de Rriveros  
Fecha de Ingreso: noviembre-2002
Ubicación: Santiago
Mensajes: 214
Antigüedad: 21 años, 7 meses
Puntos: 0
para dejar el input invisible.
__________________
www.nelhost.net
  #4 (permalink)  
Antiguo 14/07/2003, 14:41
Avatar de Saruman  
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 21 años
Puntos: 5
sigo sin entender.... es para poner el objeto mismo invisible, para que??
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.
  #5 (permalink)  
Antiguo 14/07/2003, 14:45
Avatar de Rriveros  
Fecha de Ingreso: noviembre-2002
Ubicación: Santiago
Mensajes: 214
Antigüedad: 21 años, 7 meses
Puntos: 0
ese campo se deja invisible para que no a parezca en la página, ya que necesito solo recoger el valor que esta en el input, no mostrarlo.
__________________
www.nelhost.net
  #6 (permalink)  
Antiguo 14/07/2003, 14:48
Avatar de Don Graff  
Fecha de Ingreso: noviembre-2002
Ubicación: San Bernardo - Chile
Mensajes: 410
Antigüedad: 21 años, 6 meses
Puntos: 0
y que pasa cuando quieres guardar el valor que viene en el campo...algun error¿...
  #7 (permalink)  
Antiguo 14/07/2003, 14:49
Avatar de Saruman  
Fecha de Ingreso: mayo-2003
Ubicación: Panama city, Panama, Panama
Mensajes: 1.154
Antigüedad: 21 años
Puntos: 5
y porque no haces algo mas sencillo...?? te llevas el valor junto con la pagina en un request., asi:

ejemplo:
pagina.asp?usuario=Saruman

y en la pagina registrar.asp simplemente lo optienes:

U = request("usuario")

no c si es eso lo que tratas de hacer....
__________________
Saruman

One Ring to rule them all, One Ring to find them, One Ring to bring them all and in the darkness bind them.
  #8 (permalink)  
Antiguo 15/07/2003, 00:10
AZP
 
Fecha de Ingreso: junio-2003
Mensajes: 83
Antigüedad: 21 años
Puntos: 0
A propósito de la culturilla general ...

No: input type="hydden" ...

Sí: input type="hidden" ...

AZP
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 23:14.