Hola
No he entendido muy bien cual es la configuración de tu formulario
Esto es un ejemplo
Código HTML:
Ver original<form action="RecogerSOLOCamposRellenos.asp" method="post"> <input type="text" id="1" name="cam_form" value="" tabindex="1" /> <input type="text" id="txt1" name="cam_form" value="" tabindex="2" /> <input type="text" id="txt11" name="cam_form" value="" tabindex="3" />
<input type="text" id="2" name="cam_form" value="" tabindex="5" /> <input type="text" id="txt2" name="cam_form" value="" tabindex="6" /> <input type="text" id="txt22" name="cam_form" value="" tabindex="7" />
<input type="text" id="3" name="cam_form" value="" tabindex="9" /> <input type="text" id="txt3" name="cam_form" value="" tabindex="10" /> <input type="text" id="txt33" name="cam_form" value="" tabindex="11" />
<input type="text" id="4" name="cam_form" value="" tabindex="13" /> <input type="text" id="txt4" name="cam_form" value="" tabindex="14" /> <input type="text" id="txt44" name="cam_form" value="" tabindex="15" />
<input type="submit" value="Enviar" />
RecogerSOLOCamposRellenos.asp
Código ASP:
Ver original<%
Dim Arr() ' Valores de todos los campos recibidos
For each campo in Request.Form
valCampos = valCampos & Request.Form(campo)
Next
division = Split(valCampos, ",")
for i = 0 to UBound(division)
Redim preserve Arr(i+1)
Arr(i) = Trim(division(i))
next
Dim Arr2() ' Valores del primer campo de cada tr
Dim Arr3() ' Valores del segundo campo de cada tr
Dim Arr4() ' Valores del tercer campo de cada tr
Dim Arr5() ' Valores del cuarto campo de cada tr
j = 0
for i = 0 to ubound(Arr)-1 step 4
if Arr(i) <> "" then
Redim preserve Arr2(j)
Arr2(j) = Arr(i)
j = j +1
end if
next
x = 0
for i = 1 to ubound(Arr)-1 step 4
if Arr(i) <> "" then
Redim preserve Arr3(x)
Arr3(x) = Arr(i)
x = x +1
end if
next
p = 0
for i = 2 to ubound(Arr)-1 step 4
if Arr(i) <> "" then
Redim preserve Arr4(p)
Arr4(p) = Arr(i)
p = p +1
end if
next
z = 0
for i = 3 to ubound(Arr)-1 step 4
if Arr(i) <> "" then
Redim preserve Arr5(z)
Arr5(z) = Arr(i)
z = z +1
end if
next
' conexión bd
for i = 0 to j-1
'Response.Write Arr2(i) & ","
'Response.Write Arr3(i) & ","
'Response.Write Arr4(i) & ","
'Response.Write Arr5(i) & "<br />"
SQL="INSERT INTO tabla (campo, campo2, campo3, campo4) VALUES ('"&Arr2(i)&"', '"&Arr3(i)&"', #"&Arr4(i)&"#, #"&Arr5(i)&"#);"
oConn.Execute(SQL)
next
oConn.Close
set oConn = nothing
Response.Write("Datos Insertados con éxito")
%>
Suerte