Expand my Community achievements bar.

SOLVED

Form data don't clear after closing

Avatar

Former Community Member

Hi all,

I've been happily developing these forms in LCD 8.2 until I got a call from the clients saying that there's a problem when they put the forms on a web page. If they fill out one of these forms directly via IE6 (Acrobat 7) and then close IE when finish, the form is open via IE6 from the same computer all of the previous information remains on form.

This problem doesn't happen to computers running Acrobat 9. So, it sounds like some an issue of compatibility with Acrobat 7 but can't figure out a way to fix it. No, upgrading is not an option and is not in my control.

Thanks much for any help or suggestion!

nh39

1 Accepted Solution

Avatar

Correct answer by
Level 10

Hi,

The following script will help you:

event.target.path.toString();  will give the full path including the filename.

event.target.documentFileName.toString();  will give the filename only.

Good luck,

Niall

View solution in original post

6 Replies

Avatar

Level 10

Hi,

A couple of things...

If the form returned the user's inputted data as XML submit, then you could try an xfa.host.resetData(); on the forms docReady event. Clearly this would not suit if the user part fills in the form, saves and comes back to it later. Also it would not suit if the form was submitted by email as PDF, because it would be cleared when it was subsequently opened.

The next step I am even less sure of...

You could wrap the reset script in an if statement that would test the host.name. If a form is opened in Acrobat, it will return 'Acrobat'. I am not sure what the host.name would return when the form is opened via IE6.

if (xfa.host.name !== "Acrobat")

{

     xfa.host.resetData();

}

Might be worth a test...

Niall

Avatar

Former Community Member

Hi Niall,

Thank you for responding. Your second suggestion actually can be a better solution if I can get a javascript function to distinguish the current file path.

I tried xfa.host.name and a bunch of other xfa.host's functions but they all returned the same values. It didn't matter if I opened the forms directly in Acrobat or through IE6.

I've been search around for a a way to get the current file path and pass it into a string variable. This function seems straightforward on Acrobat but not so on LC Designer.

nh39

Avatar

Correct answer by
Level 10

Hi,

The following script will help you:

event.target.path.toString();  will give the full path including the filename.

event.target.documentFileName.toString();  will give the filename only.

Good luck,

Niall

Avatar

Former Community Member

Hi Niall,

I took your first function and did this:

// get the first 4 characters of the full path

var url = event.target.path.toString().substring(0, 4);

// if the path starts with "http" reset data and initialize form

if (url == "http")

{

  xfa.host.resetData();

  xfa.form.execInitialize();

}

It seems to do the trick on my test machine and I'm waiting for the customers to test it on theirs.

Thanks, again, very much for your help!

nh39