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

My code isnt right :(

cawp
Registered: Jul 27 2007
Posts: 5

Can anyone tell me why this code doesnt populate the PHONE textfield...but does populate all the rest of the fields

if (xfa.event.newText == "xxxxxxxx") then
City = "Mississauga"
Prov = "ON"
PC = "L5L 5Z9"
Phone = "xxxxxx7328"
Cell = "xxxxxx3379"
Fax = "xxxxxx8218"
email = "xxxx [at] xxxx [dot] com"
elseif (xfa.event.newText == "xxxxxxxx") then
City = "Delaware"
Prov = "ON"
PC = "N0L 1E0"
Phone = "xxxxxx7359"
Cell = "xxxxxx1770"
Fax = "xxxxxx2707"
email = "xxxx [at] xxxxx [dot] com"
elseif (xfa.event.newText == "xxxxxxxx") then
City = "Thamesford"
Prov = "ON"
PC = "N0M 2M0"
Phone = "xxxxxx7359"
Cell = "xxxxxx1770"
Fax = "xxxxxx8261"
email = "xxxx [at] cxxxxx [dot] com"

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The one error in this code is that it's missing the terminating "endif".

But the phone field problem isn't visible in this code. More than likely it's a field naming issue. The field names must match the names used in FormCalc exactly, including any subform hierarchy.

However, there may be some other problem with the form as well. There's no way to tell without examining the PDF.

Check your form over to make sure the names and hierarchy match.

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

cawp
Registered: Jul 27 2007
Posts: 5
Thanks Thomp
I did have the endif at the end of my code. I just didnt put all of it in the post
I renamed the phone field to ph and edit all the code to reflect the change and it all works fine now. seems strange. I had the field named Phone and code said field but it didnt update..hmmm
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
There could a variable else where within Livcycle Designer called "Phone" that could be causing a problem.

George Kaiser