Forums

ASP

This topic is locked

getting form elements and their values

Posted 17 Jul 2008 16:42:36
1
has voted
17 Jul 2008 16:42:36 Dave Clarke posted:
Hi

i have made this code
<pre id=code><font face=courier size=2 id=code>
<b>&lt;%
For Each Item In Request.Form

Item=Request.Form(Item)
str2= str2 & Item &crlf

Next
%&gt;</b>
</font id=code></pre id=code>

which retrieves the values of the form elements (the rest of the script then emails me <b> str2</b>
this works fine but what i want is the name of the form element and it's value not just the value.

so instead of

black
fiesta

i want

colour = black
car = fiesta

any help much appreciated

UD4|DW8.02|DWCS3|ASP|VBScript|IIS5.1|Access|WinXPPro & WinXPHome.
www.reunite.co.uk
www.dogworld-uk.com
www.yorkshire-holiday.com

Edited by - Davecl on 17 Jul 2008 16:46:50

Replies

Replied 18 Jul 2008 23:25:08
18 Jul 2008 23:25:08 Georgi Kralev replied:
Hi Dave,

Try the following:

&lt;%
For Each Item In Request.Form

str2 = str2 & Item & " = " & Request.Form(Item) &crlf

Next
%&gt;

Hope this helps,

<b>Note:</b> I have not tested the script. Therefore, it may contain errors or not function properly.

Regards,

Georgi Kralev

Homepage: gdkralev.googlepages.com
Replied 19 Jul 2008 08:49:18
19 Jul 2008 08:49:18 Dave Clarke replied:
thanks george, will try it later <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

UD4|DW8.02|DWCS3|ASP|VBScript|IIS5.1|Access|WinXPPro & WinXPHome.
www.reunite.co.uk
www.dogworld-uk.com
www.yorkshire-holiday.com

Reply to this topic