Making another field visible based on the value selected in a drop-down box


i have form in 1 field ("billingid") become visible if value in adjacent dropdown box ("doc_type") equals value, otherwise remain invisible. although doc_type drop down text choices more verbose, i've assigned values , b choices simplify codinglater, if makes difference. field billingid's presence set "invisible" when form opened.

below copy of text in script editor containing code i've tried, has no effect. i've set form dynamic pdf , scripting language javascript. in adobe designer 7. i'm sure there's trivial i'm missing, i've spent last several hours on , gotten nowhere. appreciated!

----- form1.#subform[0].doc_type::change - (javascript, client) ----------

if(form1.#subform[0].doc_type.value == "b")
{form1.#subform[0].billingid.presence = "visible"}
else
{form1.#subform[0].billingid.presence = "invisible"}

i have used following code on 1 of forms (but using version 8). simple (no assigning of values) may give starting point anyway.

for clarification, "other" actual text of list item choice.

just add change event of drop down list replacing "other" actual text of "value b" list item:

if (xfa.event.newtext == "other")
{form1.#subform[0].billingid.presence = "visible";
}
else
{form1.#subform[0].billingid.presence = "invisible";
}

good luck :-)


More discussions in LiveCycle pre-ES (6.x and 7.x) discussions


adobe

Comments