Posting form fields ....

Results 1 to 2 of 2

Thread: Posting form fields ....

  1. #1
    PersonalFoul Guest

    Default Posting form fields ....

    ....I have a form that is creating &#060;input&#062; boxes dynamically. The &#060;input&#062; boxes are created through the use of an array shown below:<BR><BR>For numRows_ev = 0 to UBound( arrExpenseTypes, 2 )<BR> &#039;Assign Variables<BR> strExpenseName_ev = arrExpenseTypes( COLExpenseName_ev, numRows_ev ) <BR> <BR>Response.Write "&#060;input type=""text"" name=""txt""" & strExpenseName_ev & """ class=""FormText"" size=""10""&#062;&#060;/td&#062;&#060;/tr&#062;"<BR><BR>Next<BR><BR><BR>As you can see, I am inside an ASP block, hence the double quotes. The code works great in creating the form with x fields being displayed based on the amount of values in that array.<BR><BR>Problem: How do I request these values, when I don&#039;t know the names of the controls (text boxes). I dynamically create those based on the array value. I basically need to be able to request the values of each item from the form without knowing the names of the control (text boxes).<BR><BR>I could always implement a counter in this for loop and use the count as the name of the control and then check to see how many controls there are by passing the count when the form is submitted, but I&#039;ll bet there is a better way that someone here knows.<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default FOR EACH

    For Each fld In Request.Form<BR> If Left(fld,3) = "txt" Then<BR> name = Mid(fld,4)<BR> Response.Write name & ": " & Request.Form(fld) & "&#060;br/&#062;"<BR> End If<BR>Next<BR><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