K
Kevin Blount
Here's the code I tried, and found it failed...
<form runat="server" method="post" name="CreditCardForm"
id="CreditCardForm">
<%
foreach (object item in Request.Form)
{
if (item.ToString().IndexOf("__") != 0)
{
//Response.Write(item + " = " + Request.Form[item.ToString()] +
"<br />");
item.Value = Request.Form[item.ToString()];
}
}
%>
<asp:HiddenField ID="EventID" runat="server" value=""></asp:hiddenfield>
<asp:HiddenField ID="EventLanguage" runat="server"
value=""></asp:hiddenfield>
<asp:HiddenField ID="EventAction" runat="server" value=""></asp:hiddenfield>
<asp:HiddenField ID="member_email" runat="server"
value=""></asp:hiddenfield>
<asp:HiddenField ID="member_first_name" runat="server"
value=""></asp:hiddenfield>
<asp:HiddenField ID="member_last_name" runat="server"
value=""></asp:hiddenfield>
.... plus another 10 or so fields...
</form>
this fails with the error "'object' does not contain a definition for
'Value'", which makes sense to be, but I'm not sure how to reference the
HiddenField using the object name
the form that's submitted contains fields for "EventID", "member_email",
etc., and I'd like to automatically update the Value of the new form's
hidden fields without having a bunch of if statements to see if it was
previously submitted.
Actually, the ideal solution would be to also create the hiddenfields
for each form element submitted, rather than have to list them all in
the new form.
for example, if eventID, eventLanguage, eventAction and member_email
were the only fields submitted from the first form, then only these
hiddenfields would be created in the new form, likewise if
"member_first_name" and "member_last_name" where submitted as well, then
there would be hidden fields for these 2 fields as well.
any tips or tricks??
Thanks in advance
Kevin
<form runat="server" method="post" name="CreditCardForm"
id="CreditCardForm">
<%
foreach (object item in Request.Form)
{
if (item.ToString().IndexOf("__") != 0)
{
//Response.Write(item + " = " + Request.Form[item.ToString()] +
"<br />");
item.Value = Request.Form[item.ToString()];
}
}
%>
<asp:HiddenField ID="EventID" runat="server" value=""></asp:hiddenfield>
<asp:HiddenField ID="EventLanguage" runat="server"
value=""></asp:hiddenfield>
<asp:HiddenField ID="EventAction" runat="server" value=""></asp:hiddenfield>
<asp:HiddenField ID="member_email" runat="server"
value=""></asp:hiddenfield>
<asp:HiddenField ID="member_first_name" runat="server"
value=""></asp:hiddenfield>
<asp:HiddenField ID="member_last_name" runat="server"
value=""></asp:hiddenfield>
.... plus another 10 or so fields...
</form>
this fails with the error "'object' does not contain a definition for
'Value'", which makes sense to be, but I'm not sure how to reference the
HiddenField using the object name
the form that's submitted contains fields for "EventID", "member_email",
etc., and I'd like to automatically update the Value of the new form's
hidden fields without having a bunch of if statements to see if it was
previously submitted.
Actually, the ideal solution would be to also create the hiddenfields
for each form element submitted, rather than have to list them all in
the new form.
for example, if eventID, eventLanguage, eventAction and member_email
were the only fields submitted from the first form, then only these
hiddenfields would be created in the new form, likewise if
"member_first_name" and "member_last_name" where submitted as well, then
there would be hidden fields for these 2 fields as well.
any tips or tricks??
Thanks in advance
Kevin