Home
 
The page you are viewing is part of our 160,000 page PDF discussion forum archive spanning 1999-2011.
Go to the new Planet PDF forum to join the PDF community.
 

Search
 Advanced   
Sign up for a WebBoard account Archive Forum Home


PLATINUM
SPONSOR

GOLD
SPONSORS



Topic  
Go to previous topicPrev TopicGo to next topicNext Topic
Author Message
khawkins71
khawkins71

Total Messages 15

Subject:Help with array

We are looking to add functionality to our form to do the following:
User enters 6 digit ID number in field one
Based on this number, multiple other fields are filled for the user based on an array of information stored in the form about that user.

Example:
User enters 123456 in field
Form returns user name, user address, user state, user phone, etc.

We have all this information in a spreadsheet currently. Is this possible to do?


Posted: 25 Feb 2010 02:57 AM
Left Button SpacerView user's profile profileRight Button Spacer
 
 
try67
try67

Total Messages 81

Subject:Help with array

Yes, but it requires some scripting knowledge.
Basically you need to embed this array into the document in a document-level script and then add a look-up function to the ID field that will access this array, look for the matching record, and fill in the appropriate fields if found.

If you want, I can help you with this. Send me an email.


Posted: 25 Feb 2010 09:57 PM
Left Button SpacerView user's profile profileRight Button Spacer
 
 
gkaiseril
gkaiseril

Total Messages 3000

Subject:Help with array

Here are a couple of tutorials by Thom Parker:

Changing Another Field with Combo Box (Drop Down) Selection
http://www.acrobatusers.com/tutorials/2006/change_another_field

Programming List and Combo fields in Acrobat and LiveCycle forms - Part 1
http://www.acrobatusers.com/tutorials/2007/js_list_combo_livecycle/

Programming List and Combo Fields in Acrobat and LiveCycle forms- Part 2
http://www.acrobatusers.com/tutorials/2007/10/list_and_combo_in_lc


Posted: 26 Feb 2010 08:56 AM
Left Button SpacerView user's profile profileRight Button Spacer
 
 
khawkins71
khawkins71

Total Messages 15

Subject:Help with array

So I used the information provided and it works swimmingly. Now I have another issue. I need an alert such as "You must enter a valid ID" if the user enters a number that is not in the list. I know alerts are basic, but I must be trying to put it in the wrong area. Any help would be appreciated.

Here is the sample code:

//
//

//
//SetFieldValues
//
/*********** belongs to: ACRO_Document-Level.SetFieldValues ***********/
// Place all prepopulation data into a single data structure
//This script holds all the available values so that when a user enters their 6 digit code into the field it will populate other fields with information.
var RLnumber = this.getField("RLnumber")
var rlData = {
123456:{ rlName: "Dora Explorer", brNumber: "12840", brState: "WA", region: "65", area: "1", areaLead: "Ronald McDonald" },
123457:{ rlName: "Bugs Bunny", brNumber: "01491", brState: "WA", region: "175", area: "1", areaLead: "Ronald McDonald" },
123458:{ rlName: "Scooby Doo", brNumber: "08658", brState: "CA", region: "40", area: "1", areaLead: "Ronald McDonald" },
234567:{ rlName: "Betty Boop", brNumber: "03400", brState: "WA", region: "152", area: "1", areaLead: "Ronald McDonald" },
345678:{ rlName: "Daffy Duck", brNumber: "04762", brState: "WA", region: "68", area: "1", areaLead: "Ronald McDonald" },
912345:{ rlName: "Porky Pig ", brNumber: "16301 ", brState: "CA ", region: "76 ", area: "20", areaLead: "Ronald McDonald" }};

function SetFieldValues(RLnumber)
{
if (RLnumber)
{
this.getField("rlName").value = rlData[RLnumber].rlName;
this.getField("brNumber").value = rlData[RLnumber].brNumber;
this.getField("brState").value = rlData[RLnumber].brState;
this.getField("region").value = rlData[RLnumber].region;
this.getField("area").value = rlData[RLnumber].area;
this.getField("areaLead").value = rlData[RLnumber].areaLead;
}
else
{
this.getField("rlName").value = "";
this.getField("brNumber").value = "";
this.getField("brState").value = "";
this.getField("region").value = "";
this.getField("area").value = "";
this.getField("areaLead").value = "";
}
}



//

//

//
//RLnumber.ACRO_Keystroke
//
/*********** belongs to: AcroForm.RLnumber.ACRO_Keystroke ***********/
if( event.willCommit )
{
if(event.value == " ")
this.resetForm(["RLnumber","rlName","brNumber","brState","region","area","areaLead"]);
else
SetFieldValues(event.value);
}
//

//


Posted: 17 Apr 2010 03:02 AM
Left Button SpacerView user's profile profileRight Button Spacer
 
 
   
Go to previous topicPrev TopicGo to next topicNext Topic

go




Top | News | Developer | Find PDF Tools | Sponsorship | Tips | Home



Debenu's Planet PDF - a comprehensive site exclusively focused on Adobe Acrobat/PDF users and uses. Debenu's Planet PDF - Resources for Adobe Acrobat and PDF users

Please post PDF-related questions to our Planet PDF Forum forums.planetpdf.com. To send comments about this site please visit our contact page.
Planet PDF, Planet PDF Forum, PDF SDK - Debenu Quick PDF Library and Debenu are all copyright
© 2011 Debenu Pty Ltd.. All Rights Reserved. Privacy policy.