Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

radzmar
Community profile radzmar MVP
Job title here
Location here
25 BADGES
MVP

MVP

Learn more
Joined the community 06-01-2006 3:49:44 AM
Online
Top badges earned by radzmar
Customize the badges you want to showcase on your profile
Betreff: Script to calculate age from first 6 digits of a...
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
Yes, you need to replace Textfield1 with the SOM expression of the field you want to display the age in your form.

Views

535

Likes

0

Replies

0
Betreff: Script to calculate age from first 6 digits of a...
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
Here's what I would do.Put it to the exit event of your numeric field. function calculateAge(aDate) { var oDateOfBirth = new Date(aDate[0], aDate[1] - 1, aDate[2]), iDiff, oAge, oDate = new Date(); // get current date oDate.setHours(0, 0, 0); // reset hours, minutes and seconds oDate.setMilliseconds(0); // reset milliseconds iDiff = parseInt(oDate.valueOf(), 10) - oDateOfBirth.getTime() - 1, dAge = new Date(iDiff); return Math.abs(dAge.getUTCFullYear() - 1970); } var cValue = this.rawValue, aDat...

Views

544

Likes

0

Replies

12
Betreff: Using a List Box to Allow Multiple Selections to...
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
This is quite easy to accomplish.When you exit a lst field, it returns a list of strings that you can turn into an array which can be processed by a loop to get the results. var aSel = this.rawValue.split("\n"), // create an array from the selections in the list field // a reference array with a sub array containing the possible selection and the corresponding string going to be returned aStrings = [ ["2", "8 § 1324(a)(1)(A)(ii) Illegal transportation of an Alien"], ["3", "8 § 1326 Reentry of De...

Views

210

Likes

0

Replies

0
Betreff: Need a date field to be locked upon first signature
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
You don't need a script. Just select the signature field and define a new collection under the Signature tab of the Object pallette. The collection defines those fields to be locked by the signaure.

Views

264

Likes

0

Replies

1
Betreff: Get the total count of current master page
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
One way to count specific master pages is to use the resolveNodes menthod- // Count all instances of master page "MP2" xfa.form.resolveNodes("#subform.#pageSet.MP2[*]").length;

Views

238

Likes

0

Replies

0
Betreff: Digital Signature erases form field data
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
I don't see any reason why a signature field would cause a deletion of data. Have you checked, that the field in question has a data binding? If not the entered values won't get saved into the form.

Views

268

Likes

0

Replies

2
Betreff: Hidden and Visible on Add Instance Object
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
You're addressing the fields the wrong way. I' guessing that the subform "wrap" is the one, that contains the textfield and is going to be repeated, right?The loop than should look this way: var cSel = this.rawValue, oFields = xfa.resolveNodes("form1.P1.wrap[*].textfield2"), // wrap[*] means every instance of the subfom wrap. i; for (i = 0; i < oFields.length; i += 1) { oFields.item(i).presence = cSel == "1" ? "visible" : "hidden"; }

Views

502

Like

1

Replies

1
Betreff: absolut som expressions not working
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
If you're using individual name for each subform and field within the forms hierachry, there is no need to use the resolveNode() method, because you can address the nodes directly. The script editor pays attention of this and automatically decides, if it is need or not.

Views

854

Likes

0

Replies

1
Betreff: absolut som expressions not working
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
Do you face any problem with the SOM expression you get? Since the resolveNode() method is quite slow under circumstances it's the best to use the possibly shortest relative SOM expression. xfa.resolveNode() is quite the oppsite, since it start's at the very first note within the XFA tree to find the desired node. I suggest to avoid the usage of resolveNode() or resolveNodes() it possible. https://blogs.adobe.com/formfeed/2008/12/object_expressions_in_xfa.html

Views

836

Likes

0

Replies

1
Betreff: Live Cycle Designer edit caption
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
From my experience this possibly happend when the spell checking was active. Try to turn it off under [Tools] > [Options] > [Spelling].https://help.adobe.com/en_US/livecycle/11.0/DesignerHelp/WS107c29ade9134a2c562f8a7112a2a888e22-8000.2.html

Views

711

Likes

0

Replies

0
Betreff: For loop with multiple variables and math calcul...
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
I think you should change the formula the following way, to get the right results. var Fields = xfa.resolveNodes("CommRtng[*]"), Answered = 0, Values = 0, Rating = 0, i; for (i = 0; i < Fields.length; i += 1){ if (parseInt(Fields.item(i).rawValue, 10) > 0) { Answered += 1; Values += parseInt(Fields.item(i).rawValue, 10); } } Rating = 100 / (Answered * 5) * Values this.rawValue = Rating; To fire this calculation just once, put the script into a click event of a button so it's executed only when t...

Views

1.2K

Like

1

Replies

0
Betreff: Get the number of logical pages a subform spans
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
I think the problem is you're referencing th first instance of the subform and so getting always the number of pages it spans.Given your subform is named "customer" than the code xfa.layout.pageSpan(customer) really means xfa.layout.pageSpan(customer[0]) which is the first instance. For repeated objects you'll need to address the desired instance. This can be done either direct or relative. For the direct way you'll have to know the SOM expression of the addressed object in question. This means ...

Views

1.6K

Likes

0

Replies

0
Betreff: Get current master page number in formcalc/Javas...
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
Hi, so I guess you're trying to get the n-th instance of a master page used as background of a specific form page? In that case you'll need a combination of several scripting methods to find out. Given you have a field somewhere in the form, to display the current index the script looks this way: this.rawValue = xfa.layout.pageContent( xfa.layout.absPage(this).toString(), "pageArea", true).item(0).index + 1; How it works:Determine the 0-based-page number of the field with xfa.layout.absPage(this...

Views

3.0K

Likes

2

Replies

1
Betreff: Table inside table must grow together
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
Hi, you can use a script to "synchronize" the heights of the inner and outer table. Aussumed you have the following hierarchy. Put this script into the layout:ready event of the row "NestedRow" of the nested table.var cUnit = "mm", nRefH = xfa.layout.h(Table.Row, cUnit), nThisH = xfa.layout.h(this, cUnit); NestedCell1.minH = nRefH > nThisH === true ? nRefH.toString().concat(cUnit) : "5mm"; // replace 5mm with a minimum height of your choice. xfa.layout.relayout(); The script will compare the hei...

Views

2.9K

Likes

0

Replies

1
Betreff: Can i add Input Text Field into a Checkbox Caption
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
Captions aren't editable that way. But, there's a solution by John Brickman that works for static texts you can use.https://blogs.adobe.com/formfeed/2010/09/editable-floating-fields-v3.html Just put your checkbox into a subform that flows left to right, set it to be without a one caption and place a text next to it using the solution above.

Views

2.3K

Likes

0

Replies

0
Betreff: For loop with multiple variables and math calcul...
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
Hi, your current script has some issues, so it could not work. Let me explain: var Fields = xfa.resolveNodes("Page2.Comm_Sub.CommRtng[*]"); var Answered = 0; var Values = 0; var Rating = (Values / (Answered*5)) * 100 // When executed here, it's just 0 and doesn't get updated later. // var i is not declared // i cannot be equal to Fields length because the nodelist created with resolveNodes() uses 0-based indexes, so i <= Fields.length creates an out-of-bounds-error. for (i=0; i<= Fields.length; ...

Views

3.0K

Like

1

Replies

2
Betreff: Field Forms blink/flash in LiveCycle
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
This is propably an effect of one or more scripts executing over and over again. It's often because of using loops in the layout ready event or forcing to relayout the form for no reason. You should check it the existings scripts and think of a way they don not execute unneccessary often.

Views

2.1K

Likes

0

Replies

0
Betreff: TextField half border - Adobe LiveCycle
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
It's not possible with just one text field but with two overlayed, you can create a similar thing. Account Number Paste this XML code into the XML source of your form right below a -element. It adds two fields, that will look this way.

Views

3.3K

Likes

0

Replies

0
Betreff: Conditional Page Break after Subform
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
Change the scriping language to JavaScript.

Views

3.4K

Likes

0

Replies

3
Betreff: Unable to hide subform in table cell dynamically
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
Well, you can simply use this JavaScript in the calculate event of SpouseSF. this.presence = Textfield1.rawValue == "X" ? "visible" : "hidden";

Views

4.6K

Likes

0

Replies

1
Betreff: Unable to hide subform in table cell dynamically
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
So, you want to hide subform "SpouseSF" if the field "Textfield1" is empty? I have a couple of questions about that: 1. Where does the data come from for "Textfield1"? 2. What's the loop for?

Views

6.0K

Likes

0

Replies

2
Betreff: Unable to hide subform in table cell dynamically
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
Well, I can't say what's wrong, without knowing the hierachy of you form. But I can already see some problems in your script. 1. DON'T name variables or form objects (subforms, fields …) after scripting properties or default form elements! That's a no go and can cause very strange effects! So you better use other names than "data" or "length".2. This script will either return 0 or 1. It depends on, if the an element DATA below GT_TABLE below the fourth subform below the third subform below the f...

Views

4.7K

Likes

0

Replies

1
Betreff: date field auto fill text boxes
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
Hi, with FormCalc you can easily calculate dates.In the exit event of you date field, add a script like this if ($.isNull eq 0) then var nDate = Date2Num($.formattedValue, "MM/DD/YYYY") Mon = Num2Date(nDate - 6, "EEE D") Tue = Num2Date(nDate - 5, "EEE D") Wed = Num2Date(nDate - 4, "EEE D") ; and so on ... endif

Views

3.6K

Like

1

Replies

0
Betreff: Script help
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
It's not posible.

Views

3.4K

Likes

0

Replies

0
Betreff: Need a Date Time Field to be locked upon 1st tim...
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
Don't use the Action Build if possible. It creates very complex scripts, that are hard to read. Just add the following JavaScript with the script editor. if (this.isNull) { this.rawValue = util.printd("yyyymmddHHMMss", new Date()); }

Views

4.6K

Likes

0

Replies

1
Betreff: Problem with Data Flow within a form
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
If you change values of a field via scriptings it will not execute specific events like enter, click, exit or change. If a script resides in one of those events, you'll need to trigger it programically too. // Code to execute the exit event of Textfield1. Textfield1.execEvent("exit");

Views

3.3K

Likes

0

Replies

0
Betreff: Need a Date Time Field to be locked upon 1st tim...
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
To execute a script just once use an if expression. Here's an example.// Only if the field is blank, execute the following script! if (this.isNull) { // Put the script to be executed here! } The e-mail can be populated with values from form fields. I made a small macro, that helps you to create such script easily.Here you go: https://thelivecycle.blogspot.com/2012/05/mailto-maker-marco-v1.html

Views

4.7K

Likes

0

Replies

1
Betreff: ***HELP*** Need Script that populates descriptiv...
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
Hi, you can realize this with an array of nested arrays and two javascript functions. One is to populate the selectable values in the dropdown list the other to populated the description ond price depending on the selection. First, you need to add a script object to your form. Name it "formFunctions" or whatever you like. In this script object you enter the array and the two functions. // Array with data var aItems = [ // Nested arrays with item number, description and price ["123", "Chair", "99...

Views

3.4K

Likes

0

Replies

0
Betreff: Auto calculate end date
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
Hi, the end date calculation isn't that trivial, since some months have more days than others, so simply adding a fixed amount of days won't work in some circumstances.Here's a FormCalc script that will do take care of this. if (HasValue(StartDate) eq 1) then var cPattern = "DD/MM/YYYY" var nDate = Date2Num(StartDate.formattedValue, cPattern) var nStartDate = nDate var nEndDate var nCountMonths = 18 var nUltimo var nPrevMonth var nNextMonth ; Get target month while (nCountMonths gt 0) do nPrevMo...

Views

3.6K

Likes

0

Replies

0
Betreff: scripting - cannot access textfield if its value...
Avatar
Coach
MVP
radzmar
MVP

Likes

394 likes

Total Posts

2,686 posts

Correct Reply

490 solutions
Top badges earned
Coach
Ignite 3
Ignite 1
Validate 1
Give Back 50
View profile
radzmar
- Adobe LiveCycle
You can add a check for null values, to make this work.var oField = xfa.resolveNode('page.table.row.TxtElement'); if (oField.isNull) { xfa.host.messageBox("The field is empty"); } else { xfa.host.messageBox(oField.rawValue); }

Views

3.5K

Like

1

Replies

0