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

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list
SOLVED

open form with according layout

Avatar

Level 5

Hi All.

In my form when user fill the form the textField get some value. Then user save the form. Then form saved and closed. Based on value of textField I would like to open form with according layout.

What event I must to use if I have some conditions:

if textField1==3 then I would like to show only subForm1 when form is open;

if textField1==2 then I would like to show only subForm2 and subForm3 when form is open.

Thanks.

1 Accepted Solution

Avatar

Correct answer by
Level 7

Simplest way is with an if statement, switch would work also.

In the Form's docReady event [form1::docReady - (JavaScript, client)] put this:


if(textField1.rawValue == 3) //if the textfield is 3, show subForm1
{
subForm1.presence = "visible";
}

else if(textField1.rawValue == 2) //if the textfield is 2, show subForm2
{
subForm2.presence = "visible";
}

else //if the textfield is anything else, do nothing.
{}

View solution in original post

1 Reply

Avatar

Correct answer by
Level 7

Simplest way is with an if statement, switch would work also.

In the Form's docReady event [form1::docReady - (JavaScript, client)] put this:


if(textField1.rawValue == 3) //if the textfield is 3, show subForm1
{
subForm1.presence = "visible";
}

else if(textField1.rawValue == 2) //if the textfield is 2, show subForm2
{
subForm2.presence = "visible";
}

else //if the textfield is anything else, do nothing.
{}

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now