loop through form fields

Results 1 to 3 of 3

Thread: loop through form fields

  1. #1
    vs Guest

    Default loop through form fields

    how to loop through form fields on the next page to read values of the fields.<BR><BR>page1.asp<BR>I&#039;m looping through a table to display all fields. When user hits submit how do I read values in each field?<BR><BR>open connection, set recordset<BR>&#060;form action=second.asp method=post&#062;<BR>for i = 0 to objrs.fields.count -1<BR>&#060;td width=100&#062;" & objrs.fields(i).name & "" input type=text size=50 name=""" & objrs.fields(i).name & """&#062; & "&#060;/td&#062;" <BR>next<BR><BR>objrs.close<BR>set objrs = nothing<BR>&#060;input type=submit value="submit"&#062;<BR>&#060;/form&#062;<BR><BR>Thanks in advance<BR>

  2. #2
    Join Date
    Dec 1969

    Default For Each fld In Request.Form

    Is that what you mean?<BR><BR>But that will *NOT* necessarily give you the fields in order.<BR><BR>If you need them in order, see the ASPFAQs, I think the category is FORMS. Link to ASPFAQs at top right corner of this page.<BR><BR>

  3. #3
    vs Guest

    Default RE: thanks

    I&#039;ve a small form so hopefully it&#039;ll work!I&#039;m going to test it now!<BR><BR>BTW: I searched on this topic in ASP & HTML forum. I missed in FAQ!Next time i&#039;ll remember to search in FAQ as well

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts