Hide dropdown in AEM Designer | Community
Skip to main content
Yvette_s_Channe
Level 3
January 5, 2023
Solved

Hide dropdown in AEM Designer

  • January 5, 2023
  • 2 replies
  • 1779 views

I have a form with a dropdown field called "Chapter Officer" and when a user does not select anything and goes to the next field, I want this field to be hidden.

 

Can anyone help me with this?

 

Thanks in advance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by radzmar

Use the exit event of the dropdown where the user is supposed to make an selection.

Chapter_Officer.presence = this.isNull ? "hidden": "visible";

 

Btw. You cannot use objects names that begin with a digit, since this isn't allowed by XML standards. A SOM expression as Chapter_Officer.0.0 can't work. 

2 replies

Adobe Employee
January 5, 2023

What kind of form?pdf?

Yvette_s_Channe
Level 3
January 5, 2023

It was developed in AEM Designer.

Vijay_Katoch
Community Advisor
Community Advisor
January 5, 2023

Add a script like the below as per your forms field in the "enter" event.

 

 

form1.nextField::enter - (JavaScript, client)

if(DropDownList1.rawValue==null || DropDownList1.rawValue==""){
DropDownList1.presence = "hidden";
}

Yvette_s_Channe
Level 3
January 5, 2023

I put the following code on the enter event of the dropdown list.

 

form1.#subform[0].Add_Sec.Sub1.CharterOff1.Chapter_Officer.0.0::enter - (JavaScript, client)
if(Chapter_Officer.0.0.rawValue==null || DropDownList1.rawValue==""){
Chapter_Officer.0.0.presence = "hidden";
}

 

It did not work as expected.

radzmar
radzmarAccepted solution
Level 10
January 5, 2023

Use the exit event of the dropdown where the user is supposed to make an selection.

Chapter_Officer.presence = this.isNull ? "hidden": "visible";

 

Btw. You cannot use objects names that begin with a digit, since this isn't allowed by XML standards. A SOM expression as Chapter_Officer.0.0 can't work.