These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

combo boxes

kajirus3
Registered: May 18 2008
Posts: 16

Does anyone know how to use 2 combo boxes in one pdf that change different text boxes?
 
I am using java script and can do 1 no problem but can not figure out how to do two.
 
Any help would be appreciated. I amusing the example that I found here.
 

My Product Information:
Acrobat Pro 9.4, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Can you provide more information about the code you are using?

You can always change the target of your JavaScript for different field names or write a specific function for a specific set of fields.

George Kaiser

kajirus3
Registered: May 18 2008
Posts: 16
in custom keystroke i used
if( event.willCommit )
{
if(event.value == "")
this.resetForm(["DeptContact","DeptEmail","DeptNumber"]);
else
SetFieldValues(event.value);
}in the first script
in the second I just used the same script but changed the SetFieldValues to SetFieldsValues1

in document javascript



var Postoffice={ AMAWALK:{poZIP:"10501",poTelephone:" 914-245-4470",FinanceNbr:"35-0175"},
BEDFORD:{poZIP:"10506",poTelephone:" 914-234-7915",FinanceNbr:"35-0585"},
BREWSTER:{poZIP:"10509",poTelephone:" 845-279-0138",FinanceNbr:"35-0925"},
CARMEL:{poZIP:"10512",poTelephone:" 845-225-2132",FinanceNbr:"35-1225"},
COLD_SPRING:{poZIP:"10516",poTelephone:" 845-265-3486",FinanceNbr:"35-1740"},
CROSS_RIVER:{poZIP:"10518",poTelephone:" 914-763-5692",FinanceNbr:"35-2010"},
CROTON_ON_HUDSON:{poZIP:"10520",poTelephone:" 914-271-4524",FinanceNbr:"35-2020"},
GARRISON:{poZIP:"10524",poTelephone:"845-424-6495",FinanceNbr:"35-3125"},
GOLDEN_BRIDGE:{poZIP:"10526",poTelephone:" 914-232-3630",FinanceNbr:"35-3280"},
JEFFERSON_VALLEY:{poZIP:"10535",poTelephone:" 914-245-4342",FinanceNbr:"35-4215"},
KATONAH:{poZIP:"10536",poTelephone:" 914-232-2538",FinanceNbr:"35-4290"},
LAKE_PEEKSKILL:{poZIP:"10537",poTelephone:" 845-528-8718",FinanceNbr:"35-4530"},
MAHOPAC:{poZIP:"10541",poTelephone:" 845-628-2382",FinanceNbr:"35-4965"},
MOHEGAN_LAKE:{poZIP:"10547",poTelephone:" 914-528-6600",FinanceNbr:"35-5395"},
MOUNT_KISCO:{poZIP:"10549",poTelephone:" 914-666-4993",FinanceNbr:"35-5545"},
NORTH_SALEM:{poZIP:"10560",poTelephone:" 914-669-5208",FinanceNbr:"35-6010"},
PATTERSON_BREW:{poZIP:"12563",poTelephone:" 845-878-3515",FinanceNbr:"35-6395"},
POUND_RIDGE:{poZIP:"10576",poTelephone:" 914-764-5550",FinanceNbr:"35-6807"},
PURDY:{poZIP:"10578",poTelephone:" 914-277-4805",FinanceNbr:"35-6860"},
PUTNAM_VALLEY:{poZIP:"10579",poTelephone:" 845-528-2939",FinanceNbr:"35-6880"},
SHRUB_OAK:{poZIP:"10588",poTelephone:" 914-528-1648",FinanceNbr:"35-7740"},
SOMERS:{poZIP:"10589",poTelephone:" 914-276-2888",FinanceNbr:"35-7880"},
SOUTH_SALEM:{poZIP:"10590",poTelephone:" 914-533-0226",FinanceNbr:"35-8020"},
Peekskill:{poZIP:"10566",poTelephone:"914-424-6495",FinanceNbr:"35-6440"},
YorkTown:{poZIP:"10598",poTelephone:"914-962-5143",FinanceNbr:"35-9560"}};
function SetFieldValues(cPostOffice)
{
this.getField("poZIP").value=Postoffice[cPostOffice].poZIP;
this.getField("poTelephone").value=Postoffice[cPostOffice].poTelephone;
this.getField("FinanceNbr").value=Postoffice[cPostOffice].FinanceNbr;
}in the second setfieldvalues1 i used


var step2Designee={
Tremper:{Desaddr:"PO Box 515",DesTelephone:"845-744-4437",DesCity:"PineBush NY",Deszip:"12566"},
Dykeman:{Desaddr:"1865 Rt. 23",DesTelephone:"518-325-8888",DesCity:"Craryville NY",Deszip:"12521"},
Kowal:{Desaddr:"4 Court Helaine",DesTelephone:"845-856-1402",DesCity:" Port Jervis NY",Deszip:"12521"}};
function SetFieldValues1(cstep2Designee)
{
this.getField("Desaddr").value=step2Designee[cstep2Designee].Desaddr;
this.getField("DesTelephone").value=step2Designee[cstep2Designee].DesTelephone;
this.getField("DesCity").value=step2Designee[cstep2Designee].DesCity;
this.getField("Deszip").value=step2Designee[cstep2Designee].Deszip;
}
kajirus3
Registered: May 18 2008
Posts: 16
kajirus3 wrote:
in custom keystroke i used
if( event.willCommit )
{
if(event.value == "")
this.resetForm(["DeptContact","DeptEmail","DeptNumber"]);
else
SetFieldValues(event.value);
}in the first script
in the second I just used the same script but changed the SetFieldValues to SetFieldsValues1

in document javascript



var Postoffice={ AMAWALK:{poZIP:"10501",poTelephone:" 914-245-4470",FinanceNbr:"35-0175"},
BEDFORD:{poZIP:"10506",poTelephone:" 914-234-7915",FinanceNbr:"35-0585"},
BREWSTER:{poZIP:"10509",poTelephone:" 845-279-0138",FinanceNbr:"35-0925"},
CARMEL:{poZIP:"10512",poTelephone:" 845-225-2132",FinanceNbr:"35-1225"},
COLD_SPRING:{poZIP:"10516",poTelephone:" 845-265-3486",FinanceNbr:"35-1740"},
CROSS_RIVER:{poZIP:"10518",poTelephone:" 914-763-5692",FinanceNbr:"35-2010"},
CROTON_ON_HUDSON:{poZIP:"10520",poTelephone:" 914-271-4524",FinanceNbr:"35-2020"},
GARRISON:{poZIP:"10524",poTelephone:"845-424-6495",FinanceNbr:"35-3125"},
GOLDEN_BRIDGE:{poZIP:"10526",poTelephone:" 914-232-3630",FinanceNbr:"35-3280"},
JEFFERSON_VALLEY:{poZIP:"10535",poTelephone:" 914-245-4342",FinanceNbr:"35-4215"},
KATONAH:{poZIP:"10536",poTelephone:" 914-232-2538",FinanceNbr:"35-4290"},
LAKE_PEEKSKILL:{poZIP:"10537",poTelephone:" 845-528-8718",FinanceNbr:"35-4530"},
MAHOPAC:{poZIP:"10541",poTelephone:" 845-628-2382",FinanceNbr:"35-4965"},
MOHEGAN_LAKE:{poZIP:"10547",poTelephone:" 914-528-6600",FinanceNbr:"35-5395"},
MOUNT_KISCO:{poZIP:"10549",poTelephone:" 914-666-4993",FinanceNbr:"35-5545"},
NORTH_SALEM:{poZIP:"10560",poTelephone:" 914-669-5208",FinanceNbr:"35-6010"},
PATTERSON_BREW:{poZIP:"12563",poTelephone:" 845-878-3515",FinanceNbr:"35-6395"},
POUND_RIDGE:{poZIP:"10576",poTelephone:" 914-764-5550",FinanceNbr:"35-6807"},
PURDY:{poZIP:"10578",poTelephone:" 914-277-4805",FinanceNbr:"35-6860"},
PUTNAM_VALLEY:{poZIP:"10579",poTelephone:" 845-528-2939",FinanceNbr:"35-6880"},
SHRUB_OAK:{poZIP:"10588",poTelephone:" 914-528-1648",FinanceNbr:"35-7740"},
SOMERS:{poZIP:"10589",poTelephone:" 914-276-2888",FinanceNbr:"35-7880"},
SOUTH_SALEM:{poZIP:"10590",poTelephone:" 914-533-0226",FinanceNbr:"35-8020"},
Peekskill:{poZIP:"10566",poTelephone:"914-424-6495",FinanceNbr:"35-6440"},
YorkTown:{poZIP:"10598",poTelephone:"914-962-5143",FinanceNbr:"35-9560"}};
function SetFieldValues(cPostOffice)
{
this.getField("poZIP").value=Postoffice[cPostOffice].poZIP;
this.getField("poTelephone").value=Postoffice[cPostOffice].poTelephone;
this.getField("FinanceNbr").value=Postoffice[cPostOffice].FinanceNbr;
}


in the second setfieldvalues1 i used


var step2Designee={
Tremper:{Desaddr:"PO Box 515",DesTelephone:"845-744-4437",DesCity:"PineBush NY",Deszip:"12566"},
Dykeman:{Desaddr:"1865 Rt. 23",DesTelephone:"518-325-8888",DesCity:"Craryville NY",Deszip:"12521"},
Kowal:{Desaddr:"4 Court Helaine",DesTelephone:"845-856-1402",DesCity:" Port Jervis NY",Deszip:"12521"}};
function SetFieldValues1(cstep2Designee)
{
this.getField("Desaddr").value=step2Designee[cstep2Designee].Desaddr;
this.getField("DesTelephone").value=step2Designee[cstep2Designee].DesTelephone;
this.getField("DesCity").value=step2Designee[cstep2Designee].DesCity;
this.getField("Deszip").value=step2Designee[cstep2Designee].Deszip;
}