Copy link to clipboard
Copied
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
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
...Copy link to clipboard
Copied
Your Adobe Acrobat is missing updates.
Aside from that where are you running the script from?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
+++EDITED REPLY
I posted the wrong answer to your inquiry. I will post back again later.
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
Also, I just noticed this is a duplicate post. Maybe that is the reason why of the spam filter with this thread.
Copy link to clipboard
Copied
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..
Copy link to clipboard
Copied
Hey that is good info.
But for those of us who don't use LiveCycle, I don't see how your correct answer addresses the "bad parameter issue", which is the inquiry that you posted in the Adobe Acrobat support forum.
Copy link to clipboard
Copied
I doesn't get the message "Bad parameter".