Re: Can you use dynamic data in a request form
From: Bob Barrows (reb01501_at_NOyahoo.SPAMcom)
Date: 02/14/04
- Next message: bateman: "Re: Can you use dynamic data in a request form"
- Previous message: Philip Rieck: "Re: How do I reapply .Net framework to server?"
- In reply to: bateman: "Can you use dynamic data in a request form"
- Next in thread: bateman: "Re: Can you use dynamic data in a request form"
- Reply: bateman: "Re: Can you use dynamic data in a request form"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 14 Feb 2004 15:44:03 -0500
bateman wrote:
> Hi, I am am trying to write some code to perform a INSERT in SQL
> table using a loop. What would be great is a way of dynamically
> entering in data in a requaest.form
> ie the final code should look something like:
>
>
> if Request.Form("type1") = "1" then
>
>
> where the 1 in "type1" is dynamic so the code would look something
> like
>
>
> Request.Form("type" & Rs.("fld_type_id") & ") = "1" then
>
> But not sure how to form this or whether it would work, anyone have
> any idea?
Of course it would work. All you need inside the parntheses is a string
containing the name of the variable. How that string is built is irrelevant.
sVar = "type" & Rs.("fld_type_id")
if Request.Form(sVar) = "1" then
Or, if you want to fly by the seat of your pants:
if Request.Form("type" & Rs.("fld_type_id") ) = "1" then
HTH,
Bob Barrows
-- Microsoft MVP - ASP/ASP.NET Please reply to the newsgroup. This email account is my spam trap so I don't check it very often. If you must reply off-line, then remove the "NO SPAM"
- Next message: bateman: "Re: Can you use dynamic data in a request form"
- Previous message: Philip Rieck: "Re: How do I reapply .Net framework to server?"
- In reply to: bateman: "Can you use dynamic data in a request form"
- Next in thread: bateman: "Re: Can you use dynamic data in a request form"
- Reply: bateman: "Re: Can you use dynamic data in a request form"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|