Can someone help me write a script? What I have is a dropdown list (named Relation1) with three options; Self, Spouse and Significant Other. A subform1 and a Subform2, each of the subforms have the same fields. The end-user would first fill out all the fields in the subfrom1, then they would come to the dropdown list 'Relation1' - say the select 'Self', what needs to happen is the fields in subform2 prepopulate with the end-users info they typed into the fields of subform1.
Here is what my Hierarchy looks like:
Form1
Page1
PatientInfromation (Subform1)
FirstName
LastName
Address
DOB
Gender ...etc...
Relation1 - dropdown list
Self
Spouse
Sig.Other
PrimaryInurance (Subform2)
FirstName1
LastName1
Address1
DOB1
Gender1....etc...
I am having major problems with figuring out how to write these up so if someone could give me a basic code, I can figure out the rest I'm sure. I also don't know if I should use FormCalc or JavaScript. I have tried and tried to figure it on my own by reading all the questions on the forum for the last 7 HOURS.
Any help would be much appreacited!!
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
There could be many things - welcome to the LC Designer world!!
However, there are a couple of ways to sort out what is going on...
First, when you are in the script editor there is a 'check syntax' button above the window. Clicking this will check the current script. If there is a syntax error it will show red:
Next, when you are either previewing the form in LC Designer Preview or in Acrobat/Reader then pressing Control+J will bring up the Javascript Console. If there is an error in the form, it will help you find it, interpret it and resolve it - Javascript Console is your friend:
I am confident you will be able to get this working, it will just take a bit of cooperation.
I haven't seen your form, so these are a few suggestions that may or may not be applicable:
If one letter is out of place or the smallest of syntax errors, the script will fail. The tools above will help you.
Try and tie down where the problem is and I can help you. If you can share the form it will also help. There is Acrobat.com or other file sharing sites. Alternatively send me a private message and I can give you an email address.
Have a good weekend!,
Niall
Views
Replies
Total Likes
Hi,
Here is a sample: https://acrobat.com/#d=20lQl9JfL19aBtbPC1WYbw
Have a look at the script in the exit event of the relationship dropdown. There are other ways of achieving this, but try this for starters.
Basically if the user selects 'Self' the script goes through each field and assigns the value in the Patient Info to the Primary Insured. Otherwise it sets the fields to null/empty.
Hope that helps,
Niall
Views
Replies
Total Likes
Thanks SOOOO much! I do have a question tho. I copied and pasted that script
into my relation field and made the appropraite changes to the field binding
names but it's not working on my document. When I try it on yours, it works.
Could there be something I'm missing?
Views
Replies
Total Likes
Hi,
There could be many things - welcome to the LC Designer world!!
However, there are a couple of ways to sort out what is going on...
First, when you are in the script editor there is a 'check syntax' button above the window. Clicking this will check the current script. If there is a syntax error it will show red:
Next, when you are either previewing the form in LC Designer Preview or in Acrobat/Reader then pressing Control+J will bring up the Javascript Console. If there is an error in the form, it will help you find it, interpret it and resolve it - Javascript Console is your friend:
I am confident you will be able to get this working, it will just take a bit of cooperation.
I haven't seen your form, so these are a few suggestions that may or may not be applicable:
If one letter is out of place or the smallest of syntax errors, the script will fail. The tools above will help you.
Try and tie down where the problem is and I can help you. If you can share the form it will also help. There is Acrobat.com or other file sharing sites. Alternatively send me a private message and I can give you an email address.
Have a good weekend!,
Niall
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies