POST Variables not sent.
Greetings.
I'm working with a dynamic page using ASP, but the input textboxes doesn't transfer when I post the form. I build the textboxes dynamically, when I get the initial values for them. But when I submit the form, it goes to the page I need, but there are no elements in the Request.Form collection.
If I use the GET method, the variables go without problem. But I prefer using the POST method, so users can't pass parameters just by typing them at the address bar.
Before I post the code, I want to give you many thanks in advance.
Here's the ASP code. Besides, most of the variable names are in spanish. The data is stored in an bidimensional array:
sub mostrarArrPant ()
dim i
dim mes
for i = 0 to 11
mes = i + 1
call imprHTML ("<tr>")
call imprHTML ("<td width='100' align='right'><strong>" & nombreMes (mes) & ":</strong></td>")
call imprCeldaCampo (mes, "Most", arrPresupMontos(0, i))
call imprCeldaCampo (mes, "Tall", arrPresupMontos(1, i))
call imprCeldaCampo (mes, "VMSC", arrPresupMontos(2, i))
call imprHTML ("</tr>")
next
end sub
sub imprCeldaCampo (intMes, strTipo, sngValor)
dim strCampo
dim strMes
if intMes < 10 then
strMes = "0"
else
strMes = ""
end if
strMes = strMes & CStr (intMes)
strCampo = "txt" & strMes & strTipo
call imprHTML ("<td align='center' width='120'>")
call imprHTML ("<input name='" & strCampo & "' id='" & strCampo & "' type='text' value='" & _
formatNumber (sngValor, 2) & "' size='15' maxlength='15'class='alinearDerecha'>")
call imprHTML ("</td>")
end sub
It works fine, and it creates the 36 textboxes. Here is the form definition:
<form action="grabarPresupCliente.asp" method="post" enctype="multipart/form-data" name="frmMtosClte" target="_self" onSubmit="return validarMontos(this)">
It calls a JavaScript function to validate the contents of the fields.
Once again, many thanks for your help.
Oliver.
|