Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Invisible to Visible to Invisible - Filled fields turning back invisible after save/close

SBaziak
Level 2
Level 2

Good morning,

I've spent the better part of the last couple hours trying to develop a workaround to my current dilemma.

I have a dynamic PDF that has a bunch of invisible fields in it.

The user, by input of a drop-down, triggers a javascript switch which sets visibility for text fields in the form accordingly.

The form itself works fine initially. But when one of my users saves the PDF with filled in information (using Reader with Extended Rights).... when the file is reopened all visible fields set their presences back to default (which is invisible). None of the data is lost, it just looks like the presence flip-flops back to invisible.

My planned workaround to this has been to build a Doc:Ready event that will serve to check every invisible field when the file opens and set non-empty fields to visible. However, I've been having difficulty with the text fields evaluating correctly.

if

(DocumentAffected1.length > 0){

DocumentAffected1.presence

= "visible";}

I've tried Length, RawValue... used "0" and ""... and nothing seems to be working.

Is there a better way to check if my text fields have data? And if so, could you provide some example code?

I'm not a strong coder. All of my Javascript has been pinched from examples elsewhere in this forum. But it's nothing more than simple IF's and Switches.

1 Accepted Solution
pguerett
Correct answer by
Level 10
Level 10

Sounds like you need to save the state of your form as well. You can do it through code or you can let the product do it. Under File/Form Properties click the Default tab and choose the Automatically radio button on the preserve scripting changes option.

Paul

View solution in original post

0 Replies
pguerett
Correct answer by
Level 10
Level 10

Sounds like you need to save the state of your form as well. You can do it through code or you can let the product do it. Under File/Form Properties click the Default tab and choose the Automatically radio button on the preserve scripting changes option.

Paul

View solution in original post

SBaziak
Level 2
Level 2

Thank you very much. This was exactly the answer I needed.

Now I can drop all the Doc:Ready stuff.

Works like intended now.


Thank you for your help!

sivamaddy
Level 2
Level 2

Hi,

Can you please guide me on this.

I am not getting the actual output. My data lost and am seeing the first page again or sometimes getting partial data.

radio event action not happening. It only selected the radio option but no action on it.

sivamaddy