Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting input name 1

Status
Not open for further replies.

PoppapumpJ

Programmer
Dec 17, 2001
86
US
Is it possible to determine the name of a field while processing it

Example:
Page 1 one has X number of fields.

Page 2 collects more information but needs to save the information from the first.

since page one's fields are dynamically generated, I can't hardcode the names of all of the fields.

do until itemCounter > Request.Form.Count
Response.Write &quot;<input type='hidden' value='&quot; & Request.Form(itemCounter)& &quot;'>&quot;
itemCounter = itemCounter + 1
loop

is there a way to set the Name attribute = to the name from the previous page.

thanks
 
Could you gather names of the attributes from the previos page and dump them into and array or a string and split it up?

Something like:

Response.Write &quot;<input type='hidden' value=' & Request.Form(itemCounter) & &quot;' name=' & arrayName[counter] & &quot;'>&quot; ====================================
I love people. They taste just like
chicken!

 
the perfect solution to your problem is using the FOR EACH statement:

example:

<%
for each x in request.form
response.write &quot;<input type=hidden name='&quot; & x & &quot;' value='&quot; & request.form(x) & &quot;'>&quot;
next
%>

Hope this helped.

Cheers,

G.
 
Thanks,

I tested both ideas and both worked.

Gorkem's did prove to be the most effecient and least complicated.

Thanks everyone.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top