Visible/Invisible Field Issue

Avatar

29-10-2008

Hello All,



My brain is hurting on this one! I have an exclusive radio button group, Yes and No. Trying to get a text box to become visible when the user selects "No."



Here is what I have, under the "No" button, I have the following click event:



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

Main.Subform_1.Comment1.presence = "visible";

}

else{

Main.Subform_1.Comment1.presence = "invisible";

}



Under the "Yes" button, I have the following click event



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

Main.Subform_1.Comment1.presence = "invisible";

}



Something is working because the text field loads up invisible, but the problem is that selecting Yes or No does nothing. To cut out the easy stuff, both scripts are under JavaScript, and the form is a dynamic form.



Not sure if its a script issue, or how the radio buttons are put together.



Any advise would be great.

Replies

Avatar

29-10-2008

Karl



If you want the same thing to be done in FormCalc, then I have made a demo PDF for you. Give me your email address so that I can forward it to you, if interested.



In case of any queries, please feel free to contact me.

Thanks.



Syed Hussain Itiba Naqvi

itiba.naqvi@avanzasolutions.com

Avatar

30-10-2008

Ensure that your form is saved as

"Acrobat (Dynamic) XML Form (*.pdf)"



Your code is OK, but when the pdf is saved as STATIC, it does not rerender...

Avatar

Avatar
Boost 5
Level 2
try67
Level 2

Likes

14 likes

Total Posts

120 posts

Correct reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 1
View profile

Avatar
Boost 5
Level 2
try67
Level 2

Likes

14 likes

Total Posts

120 posts

Correct reply

1 solution
Top badges earned
Boost 5
Boost 3
Boost 10
Boost 1
Affirm 1
View profile
try67
Level 2

31-10-2008

I tried the same with a static PDF, and it worked when the field is set to "visible" by default, but not when it's set as "invisible" by default...

Avatar

Avatar
Level 1
_Jeff_Mantz_
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
_Jeff_Mantz_
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
View profile
_Jeff_Mantz_
Level 1

03-03-2009

I have this same problem. When the default is visible, it works. When the default is invisible it does not. I want the field to be invisible when the form is initially opened.

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

03-03-2009

Try it as a dynamic form and see if it makes a difference

Avatar

Avatar
Level 1
_Jeff_Mantz_
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
_Jeff_Mantz_
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
View profile
_Jeff_Mantz_
Level 1

03-03-2009

I set it as Acrobat 7 (Dynamic) XML Form in both the File>Form Propertied>Defaults area and in Tools>Options>Document Handling and still have the same issue. My javascript code is:



----- topmostSubform.Page1.Checkbox1::mouseUp: - (JavaScript, client) ---------------------



if (Checkbox1.rawValue == 1)

{

textfield1.presence = "visible";

textfield2.presence = "visible";

}

else

{

textfield1.presence = "invisible";

textfield2.presence = "invisible";

}



The code work fine, except that if the text field is set to invisible, it does not work at all. If the text field is set to visible, it works, but the initial state when opening the form is visible which I don't want.

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

03-03-2009

Can you change it to be Acrobat 8 Dynamic .....I seem to remember there being a bug in that version but I am not sure. Try it as 8 just to see then we can come up with a work around.

Avatar

Avatar
Level 1
_Jeff_Mantz_
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
View profile

Avatar
Level 1
_Jeff_Mantz_
Level 1

Likes

0 likes

Total Posts

3 posts

Correct reply

0 solutions
View profile
_Jeff_Mantz_
Level 1

03-03-2009

I tried that and still not working. However I set it to Dynamic. But if I go to File>Save As my only options to save are as static forms. I cannot figure out why. This is a form where there is an underlying image and the fields are on top of it, but I am not sure why that would matter.

Avatar

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Boost 500
Level 10
pguerett
Level 10

Likes

612 likes

Total Posts

7,689 posts

Correct reply

692 solutions
Top badges earned
Boost 500
Boost 50
Boost 5
Boost 3
Boost 250
View profile
pguerett
Level 10

03-03-2009

That is why ...the underlying image restricts you to a static document. You could leave it as visible but on the Initialize event of the field set it to invisible.