Go Back   CodingForums.com > :: Server side development > ASP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 11-21-2007, 10:37 PM   PM User | #1
DakotaChick
Regular Coder

 
Join Date: Mar 2006
Location: Sumter, SC
Posts: 178
Thanks: 10
Thanked 4 Times in 4 Posts
DakotaChick is an unknown quantity at this point
Request.Form Question

I'm having a litte trouble with a dynamicly built form when it comes to requesting the information contained in it from another page. Seeing as I dont necessarily know what the form elements will be called, how can I request them from another page??

Trying Request.Form(rs("Item") generates the error "The function expects a string as input."
DakotaChick is offline   Reply With Quote
Old 11-22-2007, 08:32 AM   PM User | #2
Whatever Jr.
Regular Coder

 
Join Date: Sep 2007
Posts: 120
Thanks: 0
Thanked 3 Times in 3 Posts
Whatever Jr. is an unknown quantity at this point
For Each fld In Request.Form
response.write fld & ": " & Request.Form(fld) & "<br>"
Next


HTH, Tom
Whatever Jr. is offline   Reply With Quote
Old 11-22-2007, 03:17 PM   PM User | #3
DakotaChick
Regular Coder

 
Join Date: Mar 2006
Location: Sumter, SC
Posts: 178
Thanks: 10
Thanked 4 Times in 4 Posts
DakotaChick is an unknown quantity at this point
Thanks, but there are a few fields on the form that I dont need to gather from. theres some hidden fields being used to calculate cost when quantity is input, I only need to gather the quantity fields and not the cost fields.

Any way to tell it to ignore the type="hidden" form elements?
DakotaChick is offline   Reply With Quote
Old 11-22-2007, 03:23 PM   PM User | #4
Whatever Jr.
Regular Coder

 
Join Date: Sep 2007
Posts: 120
Thanks: 0
Thanked 3 Times in 3 Posts
Whatever Jr. is an unknown quantity at this point
Prefix the hidden fields with 'hidden' and thr this:

For Each fld In Request.Form
If Instr(fld, "hidden") = 0 Then
response.write fld & ": " & Request.Form(fld) & "<br>"
End if
Next

Tom
Whatever Jr. is offline   Reply With Quote
Users who have thanked Whatever Jr. for this post:
DakotaChick (11-23-2007)
Old 12-01-2007, 07:45 AM   PM User | #5
shakir
Regular Coder

 
Join Date: Nov 2007
Posts: 110
Thanks: 0
Thanked 1 Time in 1 Post
shakir has a little shameless behaviour in the past
if the object is not exist it will show error, simple methord to avoid error use on error resu me next
shakir is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 01:09 AM.


Advertisement
Log in to turn off these ads.