Hide dropdown in AEM Designer | Community
Skip to main content
Yvette_s_Channe
Level 3
Jan 5, 2023 12:13 AM UTC
Solved

Hide dropdown in AEM Designer

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.
radzmar
radzmarAccepted solution
Level 10
Jan 5, 2023 7:35 PM UTC

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. 

7 replies

Vijay_Katoch
New Participant
Jan 5, 2023 4:51 AM UTC

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

Translate
Yvette_s_Channe
Level 3
Jan 5, 2023 6:24 PM UTC

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.

Translate
radzmar
radzmarAccepted solution
Level 10
Jan 5, 2023 7:35 PM UTC

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. 

Translate
Employee
Jan 5, 2023 12:16 AM UTC

What kind of form?pdf?

Translate
Yvette_s_Channe
Level 3
Jan 5, 2023 6:17 PM UTC

It was developed in AEM Designer.

Translate