Retrieve Form Values from UD4 Insert Record behavior Support
Ultradev: ASP
Question:
How do I retrieve the form element values of the Insert Form on the succeeding page?
Issue:
when you apply the Insert Record Behavior, the insert form submits to the same page, inserts and redirects. In this event, one can not use the Request.Form to retrieve the form values on the next page, which is the page you specify to be accessed after the Insertion. Even if you specify the same insert page to be accessed, it still will not work.
Important Notes: Please note that our solution will use Server.Transfer, which only works with IIS5 not IIS4, although most hosts do use IIS5. Using Server.Transfer is a simple and very efficient method for IIS5. There is a Tech Note at the Macromedia site explaining how to use a Session Variable instead:
http://www.macromedia.com/support/ultradev/ts/documents/passingformdata.htm
You can also decided to pass the form field values into the querystring instead:
http://www.udzone.com/go?385
Answer:
A simple solution that will work with the ASP server model and IIS5 as the
server is to change the last Response.Redirect that the Behavior builds to
Server.Transfer.
After applying the extension, search for the last several lines that the
Insert Record Behavior adds, you will see:
If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
change this to:
If (MM_editRedirectUrl <> "") Then
Server.Transfer(MM_editRedirectUrl)
End If
End If
End If
%>
You can then retrieve any form element from the form on the next page.
For example, if you had a Form element named "txtCity", you can retrieve the value of this form element on the succeeding page with:
<%= Request.Form("txtCity") %>
Happy Programming!
Omar
UDnewbie.com
Comments
Not working at DMX
You must me logged in to write a comment.