Expand my Community achievements bar.

Unable to add items to dropdown list using javascript

Avatar

Former Community Member

Hi,

I'm trying to add additional items to a dropdown list at runtime using javascript.

I'm doing this by invoking the addItem method on the dropdown list field during its initialize event.

However when I run the generated pdf in Acrobat Pro, I get the following error in the console -

GeneralError: Operation failed.

XFAObject.addItem:3:XFA:form1[0]:#subform[0]:field0[0]:initialize

Method: 'addItem' cannot be called because doing so would violate this document's permissions settings.

The pdf form has no signatures or any other stuff in it.

What additional permissions do I need to add and how ?

You can view the pdf here -

https://dl.dropboxusercontent.com/u/8022836/xfa3_test.pdf

Thanks,

Joel

1 Reply

Avatar

Level 7

Is there a reason to use the code you did? It looks like the problem is with the variable's permissions when going through the template.

This code works just fine in that same event:

this.addItem("new item");

As does:

var f = xfa.resolveNode("form1.#subform1[0].field0");

f.additem("new item");