Order of form fields

Results 1 to 2 of 2

Thread: Order of form fields

  1. #1
    Pip Guest

    Default Order of form fields

    I am looping through the fields in my form using the "For Each" construct, and entering their contents into an email. The problem is the fields in the email do not appear in the order they are on the form. I need to be able to control the content of the email so the fields appear in same order as they do in the form. I would rather not have to refer to each field by name as the ASP script is used to process many forms.<BR><BR>Can anyone help?

  2. #2
    jimmy Wang Guest

    Default RE: Order of form fields

    try this:<BR>let&#039s say you&#039ve 3 fields: FName,LName,Phone<BR>&#060;%<BR>dim myEmail<BR>dim myKey<BR>dim myFormFieldOrder<BR>dim myFormFieldValue<BR>dim myMaxField<BR><BR>&#039&#039now set-up your order<BR>myFormFieldOrder=Array("First Name","Last Name","Phone #")<BR>&#039&#039list your field var in the same order, <BR>myFormFieldValue=Array(FName,LName,Phone)<BR>< BR>myMaxField=ubound(myFormFieldOrder)<BR>for myKey=0 to myMaxField<BR>myEmail=myEmail & myFormFieldOrder(myKey) & ": " & vbcrlf<BR>myEmail=myEmail & myFormFieldValue(myKey) & vbcrlf & vbcrlf<BR>Next<BR>&#039&#039now you get myEmail the way you wanted<BR>Good luck!<BR>Jimmy Wang<BR><BR><BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts