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

formulario en desorden

Estas en el tema de formulario en desorden en el foro de ASP Clásico en Foros del Web. Buenas tengo un formulario en asp, envia todo bien pero la cosa es que envia los datos desordenados y no en el orden como esta ...
  #1 (permalink)  
Antiguo 14/06/2005, 13:37
 
Fecha de Ingreso: abril-2005
Mensajes: 247
Antigüedad: 20 años
Puntos: 1
formulario en desorden

Buenas tengo un formulario en asp, envia todo bien pero la cosa es que envia los datos desordenados y no en el orden como esta en la pagina

http://www.peruforless.com/contactus...p_depart-4.htm

aparte tb nose porque me llega el boton submit con este texto submit: Submit

Porfa ayudenme como hacer por lo menso para que al info llegue en orden de acuerdo al tml

Este es el asp que llama

<%
'on error resume next
Dim bodytext, pagename
pagename=request("pagename")
'if pagename="" THEN pagename="contact form"
'thankspage="contactus_language_thanks.htm"

'bodytext="Form Variables:" & vbcrlf
bodytext_peruforless = "<font face=Verdana, Arial, Helvetica, sans-serif><h3>New Request Group Departures - " & request.Form("Contact Person Name") & "</h3></font><p><font pointsize=8 face=Arial, Helvetica, sans-serif>"
bodytext_message = "<p><font face=Verdana, Arial, Helvetica, sans-serif><small>Following message has be sent<br><br>"
For each key in request.form
bodytext_peruforless = bodytext_peruforless & "<b>" & key & ": </b>" & request.form(key) & "<br>"
bodytext_message =bodytext_message & key & ": " & request.form(key) & "<br>"
NEXT
bodytext_peruforless = bodytext_peruforless & "</font></p>"
bodytext_message = bodytext_message & "</small></font></p>"
response.Write(bodytext_message)
'bodytext_recipient = "<font face=Arial, Helvetica, sans-serif>Dear " & request.Form("Contact Person Name") & ",<br>"
'bodytext_recipient = bodytext_recipient & "Thank you for filling out the form at Peru for Less. <br>"
'bodytext_recipient = bodytext_recipient & "Please visit us online for all your travel needs http://www.peruforless.com or email us at [email protected]." & vbcrlf & vbcrlf
'bodytext_recipient = bodytext_recipient & "To sign up for your complimentary course use coupon # 3203-04 when you fill out the form at http://multilingualcenter.com/beca.htm." & vbcrlf & vbcrlf
'bodytext_recipient = bodytext_recipient & "We will e-mail you confirmation, the starting date of your course and the phone number to access the course." & vbcrlf & vbcrlf
'bodytext_recipient = bodytext_recipient & "The Peru For Less Team"
' response.Write(bodytext_recipient)
'bodytext=bodytext & vbcrlf & "Server Variables:" & vbcrlf
'For each key in request.servervariables
' bodytext=bodytext & key & ":" & request.servervariables(key) & vbcrlf
'NEXT
Dim sender_email
sender_email=Trim(Request.Form("Contact Person e-mail"))
IF len(sender_email)=0 THEN
sender_email="TheUnknown@Tourist"
ElseIF InStr(sender_email,"@")=0 THEN
sender_email="TheUnknown@Tourist"
END IF

Dim email_length
email_length=Len(sender_email)
Dim atSymbol
atSymbol=Instr(sender_email,"@")
atSymbol=atSymbol

If atSymbol=email_length Then
sender_email="TheUnknown@Tourist"
End if

If atSymbol=1 Then
sender_email="TheUnknown@Tourist"
End if

SendJMail sender_email, request.Form("Contact Person Name"), "[email protected]", "Peru For Less website", "New Request Group Departures - " & request.Form("Contact Person Name"), "Thank You from Peru for Less!", bodytext_peruforless, bodytext_recipient
'Response.redirect "http://www.peruforless.com"

Function SendJMail(sender, senderName, recipient, recipientName, subjectPFL, subjectRecipient, bodyPFL, bodyRecipient)
'Dim JmailRecipient
'Set JMailRecipient = Server.CreateObject("JMail.SMTPMail")
'JMailRecipient.ClearRecipients()
'JMailRecipient.ServerAddress = "63.246.11.160"
'JMailRecipient.Sender = recipient
'JMailRecipient.SenderName = recipientName
'JMailRecipient.Subject = subjectRecipient
'JMailRecipient.AddRecipientEx sender,senderName
'JMailRecipient.HTMLBody = bodyRecipient
'JMailRecipient.Execute
'Set JmailRecipient=nothing

Dim Jmail
Set JMail = Server.CreateObject("JMail.SMTPMail")
JMail.ClearRecipients()
JMail.ServerAddress = "63.246.11.160"
JMail.Sender = sender
JMail.SenderName = "New Request - " & senderName
JMail.Subject = subjectPFL
JMail.AddRecipientEx recipient,recipientName
JMail.AddRecipientCC "[email protected]"
JMail.HTMLBody = bodyPFL
JMail.Execute
Set Jmail=nothing
End Function
%>
  #2 (permalink)  
Antiguo 14/06/2005, 15:01
Avatar de AlZuwaga
Colaborador
 
Fecha de Ingreso: febrero-2001
Ubicación: 34.517 S, 58.500 O
Mensajes: 14.550
Antigüedad: 24 años, 2 meses
Puntos: 535
Siempre que uses un for each para recorrer la colección form, esta va a llegar en cualquier orden. En cambio si la recorrés por su índice, va a llegar tal como están ordenados en el formulario original.

O sea, ésta parte:

Código:
For each key in request.form
bodytext_peruforless = bodytext_peruforless & "<b>" & key & ": </b>" & request.form(key) & "<br>"
bodytext_message =bodytext_message & key & ": " & request.form(key) & "<br>"
NEXT
la cambiás por ésta:

Código:
for i = 1 to Request.Form.count()
bodytext_peruforless = bodytext_peruforless & "<b>" & Request.Form.key(i) & ": </b>" & Request.Form.item(i) & "<br>"
bodytext_message =bodytext_message & Request.Form.key(i) & ": " & Request.Form.item(i) & "<br>"
next
__________________
...___...
  #3 (permalink)  
Antiguo 16/06/2005, 15:07
 
Fecha de Ingreso: abril-2005
Mensajes: 247
Antigüedad: 20 años
Puntos: 1
gracias una mas

Hol amigo gracias por responder, ya salio tenias razon un dato mas como te decia en el envio tb me envia en texto del boton SUBMIT, osea llega esto


Contact Person Name: cxc
Contact Person Telephone: xc
Contact Person Address: xc
Contact Person e-mail: xcc
Contact Person zip code: xc
Contact Person Fax: xc
.
.
.

submit: Submit

es normal que llegue esta ultima linea

submit: Submit
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 22:53.