cancel
Showing results for 
Search instead for 
Did you mean: 

Hide subform and static text based on text field

0 Kudos

Dear all,

I am new to Adobe forms.. Please help me in the below requirement.

I have a subform which has:

1. a text field

2. another subform which further has

      a) some static text

      b) another subform: it further has:

                  i) some static text and some text fields

3.some static text

now my requirement is that if

1. text field is blank then

2. subform and 3. static text should not be displayed.

Please help me in this. I know some java script need to be written but what exactly that i hav no idea and what about static text?

since we cant write script for static text. Please help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

you have to insert the a script for the form:ready event of the subform.

I created a subform containg a text field field called ARKTX and I inserted the following lines:

if ((this.resolveNode("$").ARKTX.rawValue == null || this.resolveNode("$").ARKTX.rawValue == "")) {

  this.resolveNode("$").presence = "hidden";

}

The script tests if the content of the filed ARKTX is null or an empty string. If so, the "presence" attribute of the subform is set to "hidden". Pay attention to the position of the filed ARKTX: it is inside the subform. In your case text field no.1 is out of the subform, and I think you should adapt the script. I've never do this. Check the use of "resolveNode" method.

Bye

Emanuele

Answers (1)

Answers (1)

pavan_prabhu
Active Participant
0 Kudos

Hello Suruchi,

Please follow the steps below.

1) First wrap the 3rd element(some static text) in an individual sub form.

2) Then wrap all these 3 main elements in a parent sub form of type flowed.

3) Now on sub form of 2nd element, write the Javascript in Initialize event as below.

if ( this.parent.text.rawvalue == " " )

{

     this.presence = "hidden";

}

4) Finally on sub form of 3rd element, write the Javascript in Initialize event as below


if ( this.parent.text.rawvalue == " " )

{

     this.presence = "hidden";

}

Note: Here text.rawvalue in Javascript is the value of 1st element which is a text field.