These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Change event is not fired in checkbox field after imoprt XDP-data

matka
Registered: Jun 26 2007
Posts: 11
Answered

Hello!

I have a form with a checkbox. If it's checked another field should be visible otherwise it should be invisible.
The filed txtMyField is invisible
This code is in the change event

if (chkMyCheckbox.rawValue == 1) {
txtMyField.presence = "visible";
} else {
txtMyField.presence = "invisible";
}

So far so good, but after that I do following

Open form and check chkMyCheckbox so txtMyField is visible.
Save the data in XDP-format.
Open the form again and import XDP-data, chkMyCheckbox is checked but txtMyField is invisible.
How can I do some validation after data is imported, so txtMyField is visible (if chkMyCheckbox is checked)?

thanks in advance

Mats

------------
http://www.re-pdf.com

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Traditionally, only data is saved in a LiveCycle form. This is because the visual appearance of the form is generated dynamically when Acrobat loads the file. So in early version of LiveCycle you would add code in the initialize events to explicitly rebuild any visual changes to the form, based on saved data.

But now that is mostly unnecessary. In Acrobat 8 Adobe added the ability to a LivCycle form to save visual changes. Look in the Default Tab of the Document Properties dialog. There will be an option for "Automatically" Preserving Scripting changes.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script