Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Help with Drop down making numeric field appear.

Avatar

Former Community Member
I am sure that this has been answered before but I am going blind trying to find it.

I have a form with a dropdown listing several communication methods. When "Phone" is chosen, I need a numeric field to appear requiring them to enter a phone #. I want the numeric field to be hidden unless phone is chosen from the drop down. I would also like an alert telling them that they must enter a phone #.

I stink at code and can't figure out how to make it work. Any help provided is appreciated but please translate into remedial moron for me. Thanks!
2 Replies

Avatar

Former Community Member
Set the phone field as hidden by choosing the presence property from the object pallete



In the exit event of the drop down write the code:



if(this.rawValue == "phone"){

PhoneField.presence = "visible";

xfa.host.messageBox("Please enter the phone number");

}

Avatar

Former Community Member
Hello Marleen



I have a similar problem

Don´t get this to work!

I wonder if you have an exampel-pdf of this



Sweden