Using a variable inside a request object

Results 1 to 2 of 2

Thread: Using a variable inside a request object

  1. #1
    Join Date
    Dec 1969

    Default Using a variable inside a request object

    I have a page that reads through a database, and for each record it generates two text boxes on the page. So, depending on how many records there currently are, there could be any number of text boxes actually on the page. Because of this, I use a field from the database along with a prefix to name each textbox, so that way they can all be unique, and i can distinguish between the two textboxes for each record. <BR><BR>However, on the action page, i want to use the values entered into these text boxes, but i can&#039;t reference them directly with the request object, because the name is dynamically created. I can read through the same database, and piece the name back together, but if i piece the name together and put it into a local variable, can i then use that variable inside of my request object. For example, normally the request would look like this: Request( "txtdolA" ). But instead, can i create a variable called txtname, and assign to it (based on the database and my prefix, the value of "txtdolA", and then reference the request object this way: Request( txtname ). I can&#039;t seem to get this to work like this, but there has to be a way to reference those textboxes, when they are dynamically generated.<BR><BR>thank you<BR>brad

  2. #2
    Join Date
    Dec 1969

    Default can you use something like ...

    cant you iterate through the form collection using something like :-<BR><BR>** untested **<BR><BR>&#060;% <BR>For Each item In Request.Form <BR>%&#062;<BR>Request.Form( &#060;%= item %&#062; ) = &#060;%= Request.Form(item) %&#062; &#060;BR/&#062;<BR><BR>&#060;% Next %&#062;<BR><BR>jon.<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