Skip to main content
rakeshk21205956
Inspiring
July 16, 2020
Answered

Bad parameter Error

  • July 16, 2020
  • 2 replies
  • 2100 views

I have to post this query 3rd time.. bcoz someone is marking my post as spam don't know why

 

Hi,

I have a form of 4 pages, all 4 have been turned into templates. I have dropdown on MainPage from where user can select Month, according to which corresponding template should show/hide.... ex.. if January is selected then Jan20 template should be visible rest hidden, if February is selected then February should be visible rest hidden..... Below is the script i have used,, everytime selection is changed it throws error "Bad parameter".

 

My adobe version : Adobe acrobat pro DC 20.006.20034.39303

 

Attached is the link of the file: https://www.dropbox.com/s/1sra0teo5w96k93/2020.pdf?dl=0


Here is the javascript

var a = this.getTemplate("Main_Page");
var b = this.getTemplate("Jan20");
var c = this.getTemplate("Feb20");
var d = this.getTemplate("Mar20");

 

var resp = this.getField("Monat").value;
switch (resp) {

case "January 2020":
a.hidden = true;
b.hidden = false;
c.hidden = true;
d.hidden = true;
break;

case "February 2020":
a.hidden = true;
b.hidden = true;
c.hidden = false;
d.hidden = true;
break;

case "March 2020":
a.hidden = true;
b.hidden = true;
c.hidden = true;
d.hidden = false;
break;

case "-Select-":
a.hidden = false;
b.hidden = true;
c.hidden = true;
d.hidden = true;
break;
}

 

Thanks

This topic has been closed for replies.
Correct answer rakeshk21205956

At first I didn't get the error. Then I started experimenting with the visible and not visible state of the current templates and got the error when I made all templates visible.

 

Also, I noticed that you have the master documents also marked as templates.

 

These should remain visible and not marked as templates.

 

I tried the spawn method and didn't get these issues.

 

I think you should use conditional statements with the spawn method, but as I am learning Acrobat JavaScript I may be wrong.

 

Is there a reason why not prefer to incorporate the spaen template method for this PDF?

 

 


let me explain you how to file should work.. first of all the file should be of 1 page only.......

There will be a dropdown in which will be 12 months selecting one of the months should show the attendance sheet in that single page... no extra page should be created....  then it will be filled and saved.. then for next month same file will be used to select next month enter data and save  and users should anytime select the saved month for taking printout etc.... so that data must be saved... but if i used spawn method. it will create new page...... and also that page will remain there.. ... so spawn method cannot be used..... hide/show pages is the only way i thought for creating this form in adobe acrobat....

 

anyways i made this form in livecycle and it working fine... bcoz there you can hide/show the attendance table with ease on single page..

2 replies

Bernd Alheit
Community Expert
Community Expert
July 20, 2020

I doesn't get the message "Bad parameter".

ls_rbls
Community Expert
Community Expert
July 17, 2020

Your Adobe Acrobat is missing updates.

 

Aside from that where are you running the script from?

rakeshk21205956
Inspiring
July 17, 2020

Updated to version Adobe Acrobat Pro DC version 20.009.20074  still the same issue.... i am running code from Custom keystroke also tried it running from Calculation... but same issue

ls_rbls
Community Expert
Community Expert
July 19, 2020

+++EDITED REPLY

 

I posted the wrong answer to your inquiry. I will post back again later.