Hello,
I am trying to copy one text field, EmployeeName, to another, Contacts, for an incident report form I created in LiveCycle. I am still new with Javascript, and have found this code which I thought would work:
getField("EmployeeName").value == getField("Contacts").valueAsString;
The problem I am facing is that I cannot get it to work. What I would like to have whatever is typed into the EmployeeName field to also be put into the Contacts field. I cannot use a global binding as the Contacts will be different than the EmployeeName.
Any suggestions on what to do?
Thank you,
Justin
Solved! Go to Solution.
Views
Replies
Total Likes
Hi jrvh924,
Say that your source field path is form.EmployeeName.txtEmpName
Say that your dest. field path is form.Contacts.txtContactName
Then adding the following code should work:
form.Contacts.txtContactName.rawValue = form.EmployeeName.txtEmpName.rawValue;
Please Note : I'm not sure what is wrong with your following script.. Infact, i don't recognize what style of scripting it is. But u can try changing the = = to = in your following script.
getField("EmployeeName").value = getField("Contacts").valueAsString;
Thanks,
VJ
Views
Replies
Total Likes
Hi jrvh924,
Say that your source field path is form.EmployeeName.txtEmpName
Say that your dest. field path is form.Contacts.txtContactName
Then adding the following code should work:
form.Contacts.txtContactName.rawValue = form.EmployeeName.txtEmpName.rawValue;
Please Note : I'm not sure what is wrong with your following script.. Infact, i don't recognize what style of scripting it is. But u can try changing the = = to = in your following script.
getField("EmployeeName").value = getField("Contacts").valueAsString;
Thanks,
VJ
Views
Replies
Total Likes
VJ,
That did it! I found the script online which, I thought should work, but it did not. Your code, however, works exactly as I need it to. Thank you!!
Justin
Views
Replies
Total Likes
That code you found earlier is for a form created in Acrobat, not an XFA form created in LiveCycle Designer, and VJ is right about the correction.
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies