Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

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);
}

View solution in original post

1 Reply

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);
}