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> </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"> </td>
<td width="25%" align="middle"> </td>
<td width="25%" align="middle"> </td>
<td width="25%" align="middle"> </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%"> </td>
<td width="25%"> </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%"> </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")%>
Teléfono <%=objRS("Telefono")%>
</option>
<% objRS.movenext
Loop
%>
</td>
<td width="25%"> </td>
<td width="25%"> </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")%>
Descripción
<%=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")%>
Descripción
<%=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")%>
Descripción
<%=objRS4("Descripcion")%>
<% objRS4.movenext
Loop
%>
</select></font></td>
<input=hydden name=Valor_Prod3 value="<%=Neto%>">
<td width="25%"> </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%"> </td>
<td width="25%"> </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%"> </td>
<td width="25%"> </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%"> </td>
<td width="25%"> </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")
%> |