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

Only-once default text in the form

Mesut
Registered: Apr 20 2009
Posts: 8
Answered

Hi,

In my form there are text fields which display default text. If the from is opened in pdf file, these fields show the default texts. User types new data and default text are deleted and the form saved.
If the same form is opened again than the textfields still have the default texts, not the typed text.

Data are connected to xsd file and it is a online form.

To solve this problem I created a javascript but it does not work. It was:
"initialize -javaScript, client"

"x" is a dummy field. It is only-once action.
if (DataSource.P0.x.rawValue = "null") {
DataSource.P0.x.rawValue = "b";
DataSource.P1.y.rawValue = "window";
DataSource.P2.z.rawValue = ""XP";
}

How can I solve this problem?

regards,
Mesut

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
If you enter data and save the form. Then the entered field values are saved with the form. If they are changed when the form is reopened, then something is overriding the saved data. The question is, what's overriding the saved values. You've got a complex setup, but the xsd should have no affect on this. The XSD is only used to setup the structure of the data model, not the values that are in it.

To debug it you need to create a simplified test form, where you can check each of the things that are done to the form.

In your script, the quoted "null" is the string value "null". You want to test agains the actual null value, so don't quote it. But you should not have to do this at all.

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]

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

Mesut
Registered: Apr 20 2009
Posts: 8
Two different situation:
first is with javaScript
If I use javaScript, what you said is true, saved data is overriden by default value. (In my example default value "Window" and "XP" come back. I tested it with dummy field as integer and as string, both give the same result.)
Second:
If the textfield has default value in the definition (Object-Value/ Default). This default value is not displayed in the pdf form online and input data can be saved in that field. (In the adobe LiveCycle designer "Preview PDF" the default value is displayed)
Mesut
Registered: Apr 20 2009
Posts: 8
Hi Thomp,

Problem has been solved. javaScript was not correct iso "assign to", i used "equal to".

Thanks your reaction.
regards,
Mesut
suemarostica
Registered: May 4 2009
Posts: 7
I am trying to set a text box to a default value of $10.00 and add it into the sum of the calculations. All the fields that have no default value are working fine.

Sue Marostica

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Please start a new thread.

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.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window[/b][/url]

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