Request.Form( Input Array)

Results 1 to 3 of 3

Thread: Request.Form( Input Array)

  1. #1
    Join Date
    Dec 1969

    Default Request.Form( Input Array)

    My posting page has an array of dynamically created input text boxes, i.e., these input text boxes have the same name. When submitted to the next page using the post method, I retrieve the input values with Request.Form. The value in each input boxes is separated with a comma and a space. <BR><BR>result = Request.Form("MyTextBox")<BR><BR>Suppose there four instances of MyTextBox in the submitting page.<BR>The value of result is "ABC, DEF, GHI, JKL"<BR><BR>That is fine. But if the value entered in the textboxes contains commas and spaces, like "A, BC", the varaible result in the above example will become A, BC, DEF, GHI, JKL. I will have trouble telling how many values there are and the values in each text box.<BR><BR>Can someone give me some advice or workaround on this? Thanks.

  2. #2
    Join Date
    Dec 1969

    Default RE: Request.Form( Input Array)

    I guess you&#039;re using split(string, ","), are you?<BR><BR>try this :<BR><BR>for each item in Request.Form("checkboxes")<BR>Response.Write Request.Form("checkboxes")("item")<BR>next<BR><BR> you&#039;ll see they really are seperate items, and that the split is to blame.<BR><BR>if, of course, that&#039;s what you&#039;re doing.

  3. #3
    Join Date
    Dec 1969

    Default A goof in that...

    for each item in Request.Form("checkboxes")<BR> Response.Write item<BR>next<BR><BR>No need to use<BR> Request.Form("checkboxes")("item")<BR>which is wrong, anyway, since if it *did* work you wouldn&#039;t want the "..." around item.<BR><BR>Anyway, when you use the FOR EACH form, you are *NOT* getting names of the fields (all of them are named "checkboxes" and you already specified that), you are just getting the values.<BR><BR>I guess a better naming would be:<BR><BR>for each VALUE in Request.Form("checkboxes")<BR> Response.Write VALUE<BR>next<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