How to populate two text fields based on a single drop down list selection


 

i'm trying set form 2 text fields populate default text (separate text in each text field) @ same time.

 

below screenshot of fields.

 

so, example, if select utah (from 14 options) drop down menu in "state," "oh fund center" auto-populate apwswr4949 , "oh wbs" auto-populate fr49.73.

 

here script have been using in calculate tab in properties oh fund center box:

 

var v1 = this.getfield("recstate").valueasstring; 

if (v1=="colorado") event.value = "apwswr0808"; 

if (v1=="idaho") event.value = "apwswr1616";

if (v1=="montana") event.value = "apwswr3030";

if (v1=="nebraska") event.value = "apwswr3131";

if (v1=="nevada") event.value = "apwswr3232";

if (v1=="new mexico") event.value = "apwswr3535";

if (v1=="oklahoma") event.value = "apwswr4040";

if (v1=="oregon") event.value = "apwswr4141";

if (v1=="south dakota") event.value = "apwswr4646";

if (v1=="tennessee") event.value = "apwswr4747";

if (v1=="texas") event.value = "apwswr4848";

if (v1=="utah") event.value = "apwswr4949";

if (v1=="washington") event.value = "apwswr5353";

if (v1=="wyoming") event.value = "apwswr5353";

else event.value = "";

 

it not working.   i'm @ loss on getting work, before can figure out auto-populating oh wbs box.

 

also, need both oh fund center , oh wbs boxes clear/change if new state selected.

 

any appreciated.

 

thanks.

crystal

your else command applies last if-condition, rendering rest of them moot.

you should use structure:

if () ...

else if () ...

else if () ...

else ...



More discussions in PDF Forms


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