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

Drop down values do not clear

KDCS
Registered: Sep 30 2009
Posts: 36

I created an XFA form in LCD 8.2 that has several drop down lists, each dependent on the first item selected in the first drop down list. After I make my first couple of field selections, I change my mind and would like again to select something else in the first drop down list. When I make another selection the values in the previously selected fields do not return to zero or clear all previous selected fields. The total prices remain in the previously selected fields as well as in the "grand total" field.

Is there a script to clear the fields in the above example? Or maybe there is a way to add a button that will clear only that row of fields? The form has several rows of fields.

Any help with this would be much appreciated.

Thank you.

My Product Information:
LiveCycle Designer, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
You need to use the 'clearItems()' to clear the list prior to adding the new items.
// JavaScriptDropDownList1.clearItems();

// FormCalcDropDownList1.clearItems()

George Kaiser

KDCS
Registered: Sep 30 2009
Posts: 36
Sorry, I am new to LCD and scripting. Is that all to the script? And do I add it to all drop down lists?

I put the script on the first drip down list, listing all drop down lists to clear and to clear the rawValue of the price field, but it still does not clear the price. It still holds the value of the initial selection. Any other ideas?

Thanks.
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
You will have to change the field object's name.

You will find more about this method in LiveCycle's Scripting Reference, "Help => Scripting Reference".

George Kaiser

KDCS
Registered: Sep 30 2009
Posts: 36
I can get all fields to clear but one. That field, "field 3", shows/hides depending on the first selection, "field 1". When it shows and you select a value in the drop down menu, it places a value in the price field. That is correct. But if you decide to select something else in the first field," field 1", the value in the price field stays.

I've looked for "field object's name" in LC's Scripting Reference, but found nothing. I tried to use the "TextField1.execCalculate();" script to recalculate the price field, but that did not work.

I do appreciate the help.

Thanks.