Expand my Community achievements bar.

Problems making fields visible

Avatar

Former Community Member
I am having a problem with changing fields form invisible to visible. I would like to have two text fields set to invisible by default and control their visibility with a check box. When the fields are set to invisible by default, the check box will not make them visible. If they are set to visible by default, the check box will be able to set them to invisible and change them back to visible depending on the value of the check box. Does anyone know why I cannot seem to make a field that is by default set to invisible, visible? Here is a sample of my code:



event activity="click"

script contentType="application/x-javascript"

if (chk22a.rawValue == true) {

txt22a.presence="visible";

txt22b.presence="visible";

txt22a.rawValue="XXXXXXXXXX";

txt22b.rawValue="XXXXXXXXXX";

}

else {

txt22a.presence = "invisible";

txt22b.presence = "invisible";

}

/script

/event
7 Replies

Avatar

Former Community Member
Mr. Herms,



Just change:



if (chk22a.rawValue == true) {



TO:



if (this.rawValue == true) {



Since you are in that checkbox object you use "this" to refer to itself.



I would also add:



txt22a.rawValue="";

txt22b.rawValue="";



in your "else" statement. That way you basically reset the textfields when the checkbox is unchecked.



Rick Kuhlmann

Avatar

Former Community Member
Thank you for your help. Unfortunately I am still having the same problem. In my JavaScript debugger window I display the presence of the text fields with:



console.println("txt22a.presence = " + txt22a.presence);

console.println("txt22b.presence = " + txt22b.presence);



This shows that when I check the text box, the presence is toggling between visible and invisible but the text forms still do not appear on the form.



Thanks again for your help though.

Avatar

Former Community Member
Mr Herm,



I have a couple of questions:



1. What version of Designer are you using?

2. Are you checkbox and textfields in the same subform?



One thing to check is to see if you have the form setup to be and Interactive form. See the Forms Properties for that setup.



Rick Kuhlmann

Avatar

Former Community Member
My LiveCycle version is: 8.05.2073.1.37.4024 and it is setup to be an Interactive Form.



As far as the subform, the structure of my document is one subform - topmostSubform - containing 5 pages with each page containing about 20 fields. All of the fields in question are on the same page.

Avatar

Former Community Member
Thanks for your help, Scott.

I tried to goto file -> save as and change the file type to dynamic, however only Acrobat 6 (Static), Acrobat 7 (Static) and Acrobat 8 (Static) are listed.

I tried going into Form Properties and changing the default XDP Preview format to Adobe 7 Dynamic, but I am still left with only Static save options.

Would you be able to tell me how to convert this to a Dynamic document?



*Edit:

I think that my problems saving as a dynamic file may have to do with the document structure. When viewing the Hierarchy I am shown something similar to this:



topmostSubform

-Page1

--field1

--field2

--field3

.

.

.

--field24

-Page2

-Page3

-Page4

--field25

--field26

--field27

.

.

.

--field32



There is no mention of any master pages or other sub forms. Could this be why I am having an issue?

Avatar

Former Community Member
How about this test? Create a blank form, then see if you can File, Save as a dynamic form. If so, then open your existing file, select all of your objects, copy, then paste them all in the new blank document.