Copy link to clipboard
Copied
Hello good. I have a form with a dropdown list, with several documents that when selected are displayed. So far so good, but when I go back to the option "SELECT AN OPTION" the box appears saying "invalid parameter".
I don't know why it comes out since everything is going well and fluid. Let's see if someone knows how to solve it or has the same thing happen to them.
Thank you all.
Copy link to clipboard
Copied
What script does you use at the dropdown?
Copy link to clipboard
Copied
One moment, please
Copy link to clipboard
Copied
It would really be something like this:
var a = this.getField("A").getArray();
for(var i in a)
{a[i].display = event.value == "DOCUMENTO A" ? display.visible : display.hidden;}
var b = this.getField("B").getArray();
for(var i in b)
{b[i].display = event.value == "DOCUMENTO B" ? display.visible : display.hidden;}
var t1 = this.getTemplate("plantilla1");
var t2 = this.getTemplate("plantilla2");
var p = Number(this.numPages)-1;
if(this.numPages != 1)
this.deletePages(1,p);
if (event.value == "DOCUMENTO A")
t1.spawn(numPages, false,false);
if (event.value == "DOCUMENTO B")
t2.spawn(numPages, false,false);
Copy link to clipboard
Copied
var a = this.getField("A").getArray();
for(var i in a)
{a[i].display = event.value == "DOCUMENTO A" ? display.visible : display.hidden;}
var b = this.getField("B").getArray();
for(var i in b)
{b[i].display = event.value == "DOCUMENTO B" ? display.visible : display.hidden;}
var t1 = this.getTemplate("plantilla1");
var t2 = this.getTemplate("plantilla2");
var p = Number(this.numPages)-1;
if(this.numPages != 1)
this.deletePages(1,p);
if (event.value == "DOCUMENTO A")
t1.spawn(numPages, false,false);
if (event.value == "DOCUMENTO B")
t2.spawn(numPages, false,false);
Copy link to clipboard
Copied
Can you share the file?
Copy link to clipboard
Copied
Sent
Copy link to clipboard
Copied
I don't get the message "invalid parameter".
In the Javascript console I get this:
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
TypeError: f is null
1282:byteCodeTool
Copy link to clipboard
Copied
And all those errors, how can I correct them?
Copy link to clipboard
Copied
Check the calculations in the fields. There you use non existing fields.