Planet PDF Forum Archive

Planet PDF ForumThe page you are viewing is part of our 160,000 page PDF discussion forum archive spanning 1999-2008. Would you believe we have a 2nd forum archive which covers 2008 - 2011? But... if you really want to bust-a-move head to the LIVE Planet PDF Forum. It features more than 10 conferences, covering everything from beginner discussions to in-depth developer and pre-press discussions.


How to search this archive. The quickest way is to use the filters on our Advanced Search page so that only archive pages are included in the results.


Previous | Next | (P-PDF) What's Wrong with my PDF?


Topic: Livecycle Form Help
Conf: (P-PDF) What's Wrong with my PDF?, Msg: 171291
From: Delgadoworks
Date: 8/28/2009 07:58 AM

Problem: Problem.
a.I want to add a new field to
a. search the table
b. Look at the value of index1
c. If the value = 2, return the value of in the numAmount field.
I need a for loop that will go through each instance row that the user has added.

Here is a breakdown of my situation:

1. I have a table that will allow the user to add rows when they click the plus button. Here is the code

----- form1.Page1.Table7.#subformSet[0].#subformSet[1].detailHeader2.Button2::click: - (JavaScript, client)
_detail.addInstance(this.parent.index);
xfa.form.recalculate(1);


2. The table also has a button to delete rows. Here is the code
----- form1.Page1.Table7.#subformSet[0].detail.Button2::click: - (JavaScript, client) --------------

_detail.removeInstance(this.parent.index);
xfa.form.recalculate(1);

3. The table has a drop down list named txtPartNum and that allows you make a selection. Once you have made the selection a script populates other fields in the same row. The Drop Down list contains this code:

----- form1.Page1.Table7.#subformSet[0].detail.txtPartNum::initialize: - (JavaScript, client) ------

// Populate the part number Drop-down List.
partNoScript.populatePartNo(this);

----- form1.Page1.Table7.#subformSet[0].detail.txtPartNum::change: - (JavaScript, client) ----------
// Populate the description and the unit price when we change the part number.

partNoScript.getDesc(xfa.event.newText, txtDescription, numUnitPrice, index1);


4. The following script populates the following fields:
txtPartNum,
txtDescription,
numUnitPrice,
index1
----- form1.#subform[2].#variables[0].partNoScript::partNoScript - (JavaScript, client) ------------

// This script object controls the interaction between the part number, description and unit price fields.

// When you fill the partNo, partDesc and partPrice arrays, make sure they have the same number of array indices in
// each array i.e. for every part number, there should be a matching description and price.

// Array of part numbers.


// This script object controls the interaction between the part number, description and unit price fields.

// When you fill the partNo, partDesc and partPrice arrays, make sure they have the same number of array indices in
// each array i.e. for every part number, there should be a matching description and price.

// Array of part numbers.

var partNo = new Array(" ",
"Company Labor - Regular Hours",
"Company Labor - Overtime Hours",
"Company Engineering - Regular",
"Company Engineering - Overtime",
"Company Burden",
"Subcontract Labor",
"Subcontract Engineering",
"Subcontract Material",
"Subcontract Equipment",
"Subcontract Labor & Material Bid",
"Purchased Materials",
"Materials from Inventory",
"Transportation Equipment",
"Miscellaneous Tools Shope and Garage",
"Construction Equipment",
"Rental Equipment",
"Permits",
"Legal Fees",
"Other Miscellaneous");

// Array of part descriptions.

var partDesc = new Array(" ",
"1221.9922",
"1222.9922",
"1221.9922",
"1222.9922",
"1221.9922",
"1232.9933",
"1232.9933",
"1232.9933",
"1232.9933",
"1232.9933",
"1201.99119",
"1201.99119",
"1201.99139",
"1201.99139",
"1201.99139",
"1201.99139",
"1250.994",
"1250.994",
"1250.994");

var partPrice = new Array(null,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0);


var partDesc2 = new Array(1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20);




var partDesc3 = new Array(" ",
"CLIN ",
"CLIN ",
"CLIN",
"CLIN",
"PO, NTP or C#",
"PO, NTP or C#",
"VENDOR NUMBER",
"CLIN",
"CLIN");

// Populate the part number Drop-down List.

function populatePartNo(dropdownField)
{
var i;
for (i=0; i < partNo.length; i++)
dropdownField.addItem(partNo[i]);
}

// Populate the description and unit price fields.

function getDesc(partNumber, descField, itemPrice, partNumber1, partNumber2)
{
var i;
for (i = 0; i < partNo.length; i++) // Go through the entire list of part numbers to find the one that is currently selected.
{
if (partNo[i] == partNumber) // When we find the part number currently selected.
{
descField.rawValue = partDesc[i]; // Put the description in the description field
itemPrice.rawValue = partPrice[i];
partNumber1.rawValue = partDesc2[i];
partNumber2.rawValue = partDesc3[i];// and put the unit price in the unit price field.
break; // No need to go further if there is a match.
}
}
}

Problem. I want to add a new field to
a. search the table
b. Look at the value of index1
c. If the value = 2, return the value of in the numAmount field.
The following if statement does only part of what I want. But only if the value is 2 on the first row. Not any of the other rows belowit.
----- form1.#subform[2].Table5.Row5.CL1::calculate: - (FormCalc, client) ---------------------------

if (form1.Page1.Table7.#subformSet[0].detail.index1 == 2)
then
$.rawValue = form1.Page1.Table7.#subformSet[0].detail.numAmount.rawValue
endif

I need a for loop that will go through each instance row that the user has added.


PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Aerialist 11

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link...

Download free demo

LockLizard Safeguard PDF Security

Made specifically for publishers of high value information published in PDF format, it protects your PDF...

Download free demo

Ubiquitous PDF: DIY PDF magazines, courtesy of CNET and Magazinify

Thanks to Magazinify.com, it's possible to have web articles delivered right to your inbox in PDF form. If that weren't enough, the nice folks at CNET have been nice enough to publish a step-by-step guide about how to set this all up using just a little time and a free Magazinify account.

September 06, 2011
Search Planet PDF
more searching options...
PDF Resources
Platinum Sponsor

Debenu - Unrivaled PDF Productivity | PDF Library, Acrobat Plug-Ins

Create & Edit PDF - Nitro PDF Software

Silver Sponsors

LockLizard DRM PDF Security Quick PDF Library: The Unrivaled PDF Developer Toolkit

Featured Product

Debenu PDF Aerialist 11

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.

Featured Event

Adobe Digital Marketing Summit

March 20-23, 2012 -- Salt Palace Convention Center, Salt Lake City, Utah

The Digital Marketing Summit is the premier event for digital marketers and advertisers to learn about and share key strategies for driving marketing innovation. Attend Summit to learn how you can create, measure, and optimize digital experiences to revolutionize how the world engages with ideas and information.