Hello, I have a contact information (general information) subform and a billing information subform. Is there a way to add a radio button that says "Same as General Information? This would help so that our customers don't have to retype name, address, email, etc.
Solved! Go to Solution.
Views
Replies
Total Likes
Hi,
Not naming subforms and objects is really hurting you here. It makes it so much more difficult to script.
Here is the form back to you:
https://acrobat.com/#d=MWWzrKO0Xqr0YvYEAq72nQ
You will see that I have named the billing information subform. If you look at the script in the click event of the checkbox, you can see that the objects on the left are so easy to reference now. However because the objects on the right are still in an unnamed subform, each reference needs to be resolved. It works, but is a pain.
So I would recommend that you name subforms, pages and objects as you go, as this will make scripting a breeze.
Also have a look at the script in the exit event of the general information fields, as the reference to the checkbox is now correct.
See an example here on referencing objects: http://www.assuredynamics.com/index.php/category/portfolio/referencing-objects/
Good luck,
Niall
Views
Replies
Total Likes
Hi,
This was covered a few days ago. Description and example here: Copying address details with "As Above" check box
Niall
Views
Replies
Total Likes
Interesting, this did not work for me.
http://www.taconic.com/user-assets/Images/SerologySubmissionForm.pdf
Any thoughts on what I'm doing wrong?
Views
Replies
Total Likes
Hi,
Not naming subforms and objects is really hurting you here. It makes it so much more difficult to script.
Here is the form back to you:
https://acrobat.com/#d=MWWzrKO0Xqr0YvYEAq72nQ
You will see that I have named the billing information subform. If you look at the script in the click event of the checkbox, you can see that the objects on the left are so easy to reference now. However because the objects on the right are still in an unnamed subform, each reference needs to be resolved. It works, but is a pain.
So I would recommend that you name subforms, pages and objects as you go, as this will make scripting a breeze.
Also have a look at the script in the exit event of the general information fields, as the reference to the checkbox is now correct.
See an example here on referencing objects: http://www.assuredynamics.com/index.php/category/portfolio/referencing-objects/
Good luck,
Niall
Views
Replies
Total Likes
I see exactly what you mean. So I can leave this form as is (thank you for correcting this) or I can go back, name the first subform and then change the info on the right side of the If statement. So instead of:
xfa.resolveNode("#subform.CompanyorInstitution_Contact").rawValue;
I could change each of these to:
general.CompanyorInstitution_Contact.rawValue;
Is this correct assuming I call the first subform "general"? I'm just a little hazing on how to reference a specific field. I get that the left side only needs the fields name because the check back is within that subform, but the other lines need to reference a different subform, then a specific field.
Thanks again,
Tim
Views
Replies
Total Likes
That's correct!!!
I would recommend correcting it and naming the LHS subform generalInfo.
Come back if you run into trouble
Niall
Views
Replies
Total Likes
Niall, since you were so helpful on answering that question. I thought I would hit you up with one more. One page 2 of my form, how do I get the "Total Samples on this Page" to auto-populate with the number of rows that are filled out. I don't need a validation of the data just need to know if any part of a part is filled out.
I tried instanceManager.count but I'm really confused on this.
Views
Replies
Total Likes
No problem Tim, but I'm out of the office. I'll have a look tomorrow.
Niall
Views
Replies
Total Likes
Hi Tim,
Again naming objects is recommended. I have picked the Sample ID as the object you are going to check on each row. If this object is non-null then it will be counted.
You have two pages with this table, so on page 2 I have set up a FormCalc function "Count()", which goes to each row in turn and checks the Sample ID field.
When looping through a table it is often very useful to have the rows with the same name: eg, Row1. You will see in the hierarchy on page 3 that LC Designer automatically inserts the instance number for each row: Row1[0], Row1[1],... ,Row[11]. This is based on a zero numbering system. Again on page 3 we use the FormCalc function "Count()', but the script is simpler because we can reference each instance of the Sample ID field using the wildcard *.
The script in the calculate event of the Total Samples fields on page 2 and page 3 are slightly different (showing two approaches), but both work so you can pick which solution suits you best.
Here is the link to the updated file: https://acrobat.com/#d=MWWzrKO0Xqr0YvYEAq72nQ
Good luck,
Niall
Views
Replies
Total Likes