Acrobat DC Form DropDown List with JAVA


hello, can please.

i created form dropdown list value of 48, 54, 60 , 66, if user select 48 automatically populate form fields corresponding values.  on form have qty * price = total grand total.

my problem if select 48 , put under qty =1 ok, when select value dropdown list let 54 qty have value of 1 same 60 & 66.  should have "0" value, 48 should have qty =1.

how can code show qty =1 in 48 only, if user select 54 , put qty =2 , come select 48 should 0 again....

thanks.

below javascript code.

 

// place prepopulation data single data structure

var apdata = { 48:{ toprail: "falrl-21-r-72",

                              picket: "falpk-21-r-48",

                              locking: "falls-21-r-72",

                              midbottom: "falrl-23-r-72",

                              post: "falpt-21-r-70-b",

                              spacer: "falsp-23-r-70",

                              endcap: "falec-21",

                        trsz: "72 in",

                              picksz: "48 in",

                              locsz: "72 in",

                              midbotsz: "72 in",

                              posz: "70 in",

                              spsz: "70 in",

                              ecsz: "2 in",

                        trpc: "100",

                              pickpc: "100",

                              locpc: "100",

                              midbotpc: "100",

                              popc: "100",

                              sppc: "100",

                              ecpc: "100" },

                 54:{ toprail: "falrl-21-r-72",

                              picket: "falpk-21-r-54",

                              locking: "falls-21-r-72",

                              midbottom: "falrl-23-r-72",

                              post: "falpt-21-r-82-c",

                              spacer: "falsp-23-r-70",

                              endcap: "falec-21",

                        trsz: "72 in",

                              picksz: "54 in",

                              locsz: "72 in",

                              midbotsz: "72 in",

                              posz: "82 in",

                              spsz: "70 in",

                              ecsz: "2 in",

                        trpc: "200",

                              pickpc: "200",

                              locpc: "200",

                              midbotpc: "200",

                              popc: "200",

                              sppc: "200",

                              ecpc: "200" },

                 60 :{ toprail: "falrl-21-r-72",

                              picket: "falpk-21-r-60",

                              locking: "falls-21-r-72",

                              midbottom: "falrl-23-r-72",

                              post: "falpt-21-r-82-c",

                              spacer: "falsp-23-r-70",

                              endcap: "falec-21",

                        trsz: "72 in",

                              picksz: "60 in",

                              locsz: "72 in",

                              midbotsz: "72 in",

                              posz: "82 in",

                              spsz: "70 in",

                              ecsz: "2 in",

                        trpc: "300",

                              pickpc: "300",

                              locpc: "300",

                              midbotpc: "300",

                              popc: "300",

                              sppc: "300",

                              ecpc: "300" },

                 66 :{ toprail: "falrl-21-r-72",

                              picket: "falpk-21-r-66",

                              locking: "falls-21-r-72",

                              midbottom: "falrl-23-r-72",

                              post: "falpt-21-r-88-b",

                              spacer: "falsp-23-r-70",

                              endcap: "falec-21",

                        trsz: "72 in",

                              picksz: "66 in",

                              locsz: "72 in",

                              midbotsz: "72 in",

                              posz: "88 in",

                              spsz: "70 in",

                              ecsz: "2 in",

                        trpc: "400",

                              pickpc: "400",

                              locpc: "400",

                              midbotpc: "400",

                              popc: "400",

                              sppc: "400",

                              ecpc: "400" }};

               

function setfieldvalues(cdeptname)

{

// product item codes 

  this.getfield("toprailpi").value = apdata[cdeptname].toprail;

  this.getfield("picpi").value = apdata[cdeptname].picket;

  this.getfield("locspi").value = apdata[cdeptname].locking;

  this.getfield("mbrpi").value = apdata[cdeptname].midbottom;

  this.getfield("postpi").value = apdata[cdeptname].post;

  this.getfield("spacerpi").value = apdata[cdeptname].spacer;

  this.getfield("postecpi").value = apdata[cdeptname].endcap;

// product sizes

  this.getfield("toprailsz").value = apdata[cdeptname].trsz;

  this.getfield("picsz").value = apdata[cdeptname].picksz;

  this.getfield("locsz").value = apdata[cdeptname].locsz;

  this.getfield("mbrsz").value = apdata[cdeptname].midbotsz;

  this.getfield("postsz").value = apdata[cdeptname].posz;

  this.getfield("spacersz").value = apdata[cdeptname].spsz;

  this.getfield("postecsz").value = apdata[cdeptname].ecsz;

// product prices

  this.getfield("toprailpc").value = apdata[cdeptname].trpc;

  this.getfield("picpc").value = apdata[cdeptname].pickpc;

  this.getfield("locspc").value = apdata[cdeptname].locpc;

  this.getfield("mbrpc").value = apdata[cdeptname].midbotpc;

  this.getfield("postpc").value = apdata[cdeptname].popc;

  this.getfield("spacerpc").value = apdata[cdeptname].sppc;

  this.getfield("postecpc").value = apdata[cdeptname].ecpc;

}

i resolved problem adding if else in dropdown.... thanks



More discussions in Acrobat Reader


adobe

Comments

Popular posts from this blog

Illustrator CS6 Ocurrío un error E/S en el archivo.

Why is os_ViewContainer running?

Animate - problem with duplicating scripts after loop