0

i have one landing page with two text box I want to grab the values in the text box entered by customers into another landing page. How can I grab value of text box passed from the "form" on the First landing page to the second landing page.

0

There are multiple ways two best of them are as follows: 1) send value as url parameter(&value1=abc&value2=xyz) and get values and display in second page by using apexpage.getparameter method 2) use same controller & same variable for both pages.

0

There are 2 languages (Server Side JavaScript "SSJS" and AMPSCRIPT) and 2 methods of posting form data (GET and POST).

Part I - LandingPage1

Using the HTML you have 2 choices to pass the form data

a) For "GET" method

<form id="" method="GET" action="#">

b) For "POST" method

<form id="" method="POST" action="#">

So if you wish to use "GET" method your form would be

<form id="" method="GET" action="landingpage2"> 
      <input type="text" name="a">
      <input type="text" name="b">
</form>

If you chose "POST" method your form would be

<form id="" method="POST" action="landingpage2"> 
     <input type="text" name="a">
     <input type="text" name="b">
</form>

Part II - LandingPage2

1) Server Side JavaScript on LandingPage2 for receiving the data passed from LandingPage1

Based on the method you chose in

After declaring variables for capturing the form values passed var a, b

a) GET:

a = Request.GetQueryStringParameter("a");

b) POST:

a = Request.GetFormField("a");

2) AMPSCRIPT on LandingPage2 for receiving the data passed from LandingPage1

After declaring variables for capturing the form values passed var @a, @b

a) GET:

set @a = QUERYPARAMETER("a")   
     or 
set @b = RequestParameter("b")

BOTH QUERYPARAMETER and RequestParameter functions work for querystring parameters

b) POST

set @a = RequestParameter("a")

AmpScript's RequestParameter function is special in that returns the value of a parameter passed either as a query string of a landing page URL or passed via a form post provided that the form is set to a method of "post" and not "get".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.