Expand my Community achievements bar.

SOLVED

Store value from webpage before redirecting to another

Avatar

Level 4

Hi All,

Iam trying to create a webpage in adobe campaign classic which it has fisrtname,lastname and 2 buttons.

When the customer clicks on anyone of the buttons then they will be redirected to another page.

My issue is that I need to store in a schema a value or any identification system to know which customer clicked on which redirection button.

With the below flow I am able to store the firstname lastname to my schema but which button the customer chose  I am not able to get it. In page1 iam taking the firstname,lastname details then storing i schema after that the two buttons page(page2) will come. after that how i can store is my doubt.

Greeshma_Sampath1_0-1633340645418.png

 

Could someone please help me out in this?

 

Thanks & Regards,

Greeshma

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @Greeshma_Sampath1 ,

 

Create a ctx variable in web app and use the javascript to update the value.

 

HTML Code:

<button type="button" onclick="myFunction('button1')">Button 1</button>

<button type="button" onclick="myFunction('button2')">Button 2</button>

Now use this js code to save to ctx variable.

function myFunction(button){
document.controller.setValue('/ctx/vars/buttonClicked',button);
}

     Manoj
     Find me on LinkedIn

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hello @Greeshma_Sampath1 ,

 

Create a ctx variable in web app and use the javascript to update the value.

 

HTML Code:

<button type="button" onclick="myFunction('button1')">Button 1</button>

<button type="button" onclick="myFunction('button2')">Button 2</button>

Now use this js code to save to ctx variable.

function myFunction(button){
document.controller.setValue('/ctx/vars/buttonClicked',button);
}

     Manoj
     Find me on LinkedIn