davecapone
Programmer
I am looking to populate variable name using a variable. It is kind of hard to explain so let me write it out in asp code a bit.
<%
for each varName in request.form
varName=request.form(varName"
next
%>
In other words if I have 20 variables on a form with a given name, I want to create standalone variables with those names containing the data of the form fields. The reason I'm looking to do this is I have a script that based upon a certain field will either use data enter in a form or pull data from a database and I think the code would be more efficient is the logic of where it is to come from is made once and populated in simple variable names instead of testing where the data is located and using rd(varName) or request.form(varName) in every place I need to use/manipulate the data.
Is there a way to do what I asked or another way to accomplish what I would like to accomplish?
Thanks,
David Capone
<%
for each varName in request.form
varName=request.form(varName"
next
%>
In other words if I have 20 variables on a form with a given name, I want to create standalone variables with those names containing the data of the form fields. The reason I'm looking to do this is I have a script that based upon a certain field will either use data enter in a form or pull data from a database and I think the code would be more efficient is the logic of where it is to come from is made once and populated in simple variable names instead of testing where the data is located and using rd(varName) or request.form(varName) in every place I need to use/manipulate the data.
Is there a way to do what I asked or another way to accomplish what I would like to accomplish?
Thanks,
David Capone