|
-
Aug 21st, 2001, 03:14 AM
#1
Thread Starter
Frenzied Member
ASP Form
This has sat in the ASP forum for a couple of days but I haven't had any response... can someone help..
I'm reasonably new to ASP so forgive me if this is all old hat.
I have a FORM on a HTML page, method=POST.
I also have an ASP page that's entire purpose is to e-mail the contents of the form to a nominated person. To save on typing my ASP page contains this code to build the body of the e-mail
Code:
for each fItem in Request.Form
tmpbody=tmpbody+fitem+" : "
tmpbody=tmpbody+Request.Form(fItem)
tmpbody=tmpbody+vbcrlf
next
It then sends it using the CDONTS.NewMail object.
This all works fine except for the fact that the form entries appear to be in a random order in the e-mail - is there a way I can control the order of the form elements without having to do a separate Request.Form("this item") for each form element?
I've tried the TabIndex property of each <INPUT item on the form but it doesn't seem to make a difference..
or am I going about the whole thing the wrong way..?
'Buzby'
Visual Basic Developer
"I'm moving to Theory. Everything works there."
-
Aug 21st, 2001, 03:46 AM
#2
Hyperactive Member
In my limited experience you cannot order the forms contents or output them in a different order unless you use an array or the the "This Item" method. I don't suppose it's logical to restructure your form object in the way you want your Email represented ?
There may be other ways of doing wot you're doing, I use the
4guysfromRolla
Website for ASP if I dont get a response here (Of course, I always post it here first, loyalty etc etc..)
FBP

Best Bar.....
-
Aug 21st, 2001, 03:47 AM
#3
Fanatic Member
I don't know whether this helps but I normally use something like the following:
VB Code:
Dim tmpbody,i
If Request.Form.Count <> 0 then
for i = 1 to Request.Form.Count
If UCASE(Trim(Request.Form.Key(i))) <> "IGNORE" Then
tmpbody=tmpbody & Request.Form(i).Item & Request.Form.Key(i) & chr(13)
End If
Next
Else
tmpbody="No Form Found."
End If
Where the Submit / Reset buttons or any other irrelevant controls are given the name "ignore".
and all other controls are given the name of the form field (eg the question if it is a survey)
This seems to send the controls in a consistent Top/Down Order - at least in IE (am not sure about netscape).
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|