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

Error when assigning value from one text field to another

averilh
Registered: Jan 20 2009
Posts: 6

Hi,
I am a newbie to adobe forms and I am having difficulty assigning one text field to another. In the pdf, the actual value in the assigned field is 'Object60308796'.

On Event Enter on the text field USR_EMAIL:
Notif_subform.RFAP_CONTACT.rawValue = USR_EMAIL.value;

But in the pdf ... I enter a string in field USR_EMAIL, and in the field Notif_subform.RFAP_CONTACT, the field value is 'Object60308796'.

Many thanks
averil

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Do not use the Enter event. This event triggers when the cursor (mouse) enters the objects boundary. Use the validate event instead. This event fires after data has been entered into the field. You also have an error in your code. If the code is on an event attached to the "USR_EMAIL" field, then it should be:
   Notif_subform.RFAP_CONTACT.rawValue = this.rawValue;
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

averilh
Registered: Jan 20 2009
Posts: 6
Hi Thom,
Thanks so much for your response.

I did as advised and changed the event to 'validate', and replaced the code with:
Notif_subform.RFAP_CONTACT.rawValue = this.rawValue;

But, receive the error:
USR_EMAIL validate failed


I also tried the following in the 'validate' event:
Notif_subform.RFAP_CONTACT.rawValue = USR_EMAIL.rawValue; (same error as above)

Notif_subform.RFAP_CONTACT.rawValue = this.value; (field RFAP_CONTACT is populated
with 'Object50364372')

Appreciate your help.

Thanks
Averil
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Sorry, when you use a validate event you have to return a true/false value. place this a the last line in the script.

true;

That should help.

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

averilh
Registered: Jan 20 2009
Posts: 6
Hi Thom,
It works perfectly.

Thanks so much for your help

Averil