Ver Mensaje Individual
  #6 (permalink)  
Antiguo 21/02/2008, 14:46
Avatar de leoaraguas
leoaraguas
 
Fecha de Ingreso: febrero-2008
Ubicación: Rosario
Mensajes: 17
Antigüedad: 17 años, 2 meses
Puntos: 0
Re: agregar varios con varios input text

Divertite con esto. =)


<NOMBRE DEL ARCHIVO CAMPOS.ASP >

Código:
<%
if request.form("submit") = "Enviar" then
cadena= ""
valores = ""
	for each id in request.form()
		if id <> "Submit" then  'para que no te incorpore el boton de envio
			campos = campos & id & ","
			valores = valores & "'" & request.form(id) & "',"
		end if
	next
			cadena = "INSER INTO NombreTabla("&campos&") VALUES ("&valores&")" 
			response.write cadena
else
%>
<form action="campos.asp" method="post">
	<input type="text" name="codigo" value="" />
	<input type="text" name="nombre" value="" />
	<input type="text" name="apellido" value="" />
	<input type="text" name="edad" value="" />
	<input type="text" name="estado" value="" />
	<input type="submit" value="Enviar" name="Submit"/>
</form>
<%end if%>
Saludos