cancel
Showing results for 
Search instead for 
Did you mean: 

Hide a subform or a field based on the value of another text field.

Former Member
0 Kudos

Hi friends,

My requirement is , I have a page(name:page1) in that page i have a subform(name:advertiser) in that subform i have text field(name:bp). Then i have a new subform(name:display) , In this display subform I have a text field(name:party). Now my requirement is to hide this subform('Display') or this field(party) if the value of text field-party = value of text field-bp.

Ths basic problem i am facing is in addressing these fields .It's a little confusing as in many post it's refered as $.value, $.record.value, xfa.data....etc

Preferably i want to use javascript. Kindly let me know the appropriate event also.

P.S- I know this question has been answered many times before but i tried many of those combinations but to no avail.

I mainly want to know how to access any element in a form i.e it's name. Also the link provided in previous posts for 'Basis of java scripting' is not available anymore (http://www.adobe.com/devnet/livecycle/articles/lc_designer_scripting_basics/lc_designer_scripting_basics.pdf) .

So any fresh links will be helpfull.

Thanks in advance.

Edited by: jaiparesh on Sep 19, 2010 7:54 PM

Edited by: jaiparesh on Sep 19, 2010 7:57 PM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

you can write code in the initialise event of that subform.

The sample code as follows:

if ( TextField6.rawValue == "601" ){

Image3.presence = "invisible";

Image4.presence = "invisible";

Image5.presence = "invisible";

}

where Image3 is the name of the UI element.

chintan_virani
Active Contributor
0 Kudos

When you have Texfields within a subform you should access it via subform name. Let's say you have following hierarchy

Subform1

|-- TextField1

Subform2

|-- TextField2

Now when you want to access TextField2 you should be using as Subform2.TextField2 and for TextField1 it should be accessed as Subform1.TextField1

OttoGold
Active Contributor
0 Kudos

Keep relative addressing in mind. If you place a sript on the subform level, then you can use for example this.field1.rawValue to access the field1 value under your subform. Or you can use this.parent, what would lead to the parent subform of the element, where you run the script. Otto