Dynamic drop down lists


hi,

i've got drop down list want change list items, depending on of 2 checkboxes selected. have pinched script below purchase order sample form.

var travellist = new array(" ",
"a1 - taking duty @ new station",
"a2 - free journeys home",
"a3 - excess fares in lieu of lodging allowance");

function populatetravel(dropdownfield)
{
var i;
(i=0; < travellist.length; i++)
dropdownfield.additem(travellist[i]);
}

i have similar array , function populate drop down list list of values. unfortunately, when select 1 checkbox, change mind , select another, doesn't replace list's values new list, adds them onto end.

having taken script sample form, can't amend well. i'm assuming additem part needs replaceitem. can tell me need do?

in summary, have 2 versions of above script. relevant function called depending on 2 checkboxs' value. script adds array of values drop down list, user changing mind see both lists added onto each other. want user's selection blank list , add array of values user sees 1 array's list of values.

i'd appreciate help!

thanks,

craig

i'm not sure if solve problem, here information taken scripting_readme.htm:

"calculate event not fire automatically after adding or removing subform"

if add or remove instance of subform, calculate event not automatically fire , update calculations include values added or deleted subform. update calculations, must update script invoke recalculate method form. example recalculate form after adding instance of subform appears in dynamic interactive purchase order sample:

// invoke instance manager add 1 instance of detail subform.
_detail.addinstance(1);
//invoke recalculate method include field values added subform in calculations.
xfa.form.recalculate(1);


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


adobe

Comments