azz
04-09-2003, 11:32 AM
hey,
I have a very simple form that reads in three values and passes them to an ASP form handler. I want this ASP page to iterate through an array and use the values from the array to call the specific values from the form. ie:
<body>
<%
var formList = new Array();
formList[0] = 'fname'
formList[1] = 'mname'
formList[2] = 'sname'
var fullname=''
for (i=0; i<=formList.length; i++)
{ fieldName = formList[i];
val=Request.Form(fieldName);
fullname = fullname + val + ' ' }
Response.Write('Hello '+ fullname);
%>
<body>
When I run this, I get told that the Request.Form command is expecting a string value. Don't know if this is a specific limitation of the Request.Form command, but is there a way around this problem?
May look simple, but it will eventually need to handle an array of 50 or so field names and it would be good if iI could use the loop way of doing things.
Any ideas?
Cheers
Azz
I have a very simple form that reads in three values and passes them to an ASP form handler. I want this ASP page to iterate through an array and use the values from the array to call the specific values from the form. ie:
<body>
<%
var formList = new Array();
formList[0] = 'fname'
formList[1] = 'mname'
formList[2] = 'sname'
var fullname=''
for (i=0; i<=formList.length; i++)
{ fieldName = formList[i];
val=Request.Form(fieldName);
fullname = fullname + val + ' ' }
Response.Write('Hello '+ fullname);
%>
<body>
When I run this, I get told that the Request.Form command is expecting a string value. Don't know if this is a specific limitation of the Request.Form command, but is there a way around this problem?
May look simple, but it will eventually need to handle an array of 50 or so field names and it would be good if iI could use the loop way of doing things.
Any ideas?
Cheers
Azz