Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
2

Bad parameter message when selecting drop down with JavaScript to spawn/delete pages

Explorer ,
Aug 21, 2023 Aug 21, 2023

I have a drop down field that will spawn page templates based on the drop down selection. If the user changes their selection, the previsouly-spawned template pp. will be deleted and new template pp. will spawn. This works well, but sometimes a "Bad parameter" message will pop-up when a new selection is made. The function still works (the proper pages will still spawn/delete), but the message pops up. I don't have any JavaScript errors and cannot find a consistant reason why this message will pop up (I can go through several choices/changes without any bad parameter messages and then the message will pop up--but still delete/spawn correctly-- and then it won't pop up on the next selection or maybe will pop up on several selections in a row). Does anyone know what could be causing this message to pop up and/or how to stop it? Any input would be greatly appreciated. 

 

FYI: I've also searched and tried other troubleshooting tips including removing tags (there are none in the file)

TOPICS
General troubleshooting , JavaScript , PDF forms
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 22, 2023 Aug 22, 2023

Post a screenshot of the popup.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 22, 2023 Aug 22, 2023

Bad parameter Screenshot.jpgexpand image

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 22, 2023 Aug 22, 2023

As stated previously, even when this does pop up, when you hit "OK" the form functions as intended. Sometimes (rarely) after you hit the "OK" button the drop down stays on the previous selection and you have to make your new choice again. When you make the choice again the form functions as intended and the Bad parameter message does not pop up.

I hope this is helpful.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 22, 2023 Aug 22, 2023

Try this:

Press the ctrl key and click on the OK button.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 22, 2023 Aug 22, 2023

Tried it. The message still reappeared with another choice.  

I gave more information in my response to JR Boulay, including the Custom Keystroke Script I am using, as well a the fact that there is also a Validation Script for making other fields visible/hidden based on the selection as well as resetting fields. As mentioned in my original note, the message pop up does not happen all the time or in any consistent way that I have been able to determine, but one thing that seems to trigger the first time that the message pops up is when I fill out some of the fields on the spawned template pp. before making another drop down selection. But this even this does not always cause the Bad parameter message to pop up.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 22, 2023 Aug 22, 2023

In the document there is a entry with a bad parameter.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 22, 2023 Aug 22, 2023

Is there a way to find the entry with the bad parameter?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 22, 2023 Aug 22, 2023

In which action/trigger/event did you place this script?


Acrobate du PDF, InDesigner et Photoshoptographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 22, 2023 Aug 22, 2023

The script for the spawning/deleting of template pp. is a Custom Keystoke Script in the drop down. "Commit selected value immediately" is selected in the drop down's Option tab. There is also a Custom Validation Script for the drop down to make fields visible/hidden based on selection as well as reset fields.

 

Here is the Custom Keystroke Script that spawns/deletes the template pp.:  

if(event.willCommit)
{
   switch(event.value)
   {
      case "Closely Held Business":
           this.getTemplate("RVW-T1 CHB").spawn(this.numPages,false, false);
   this.getTemplate("RVW-T2").spawn(this.numPages,false, false);
 
          break;
      case "ILIT":
           this.getTemplate("RVW-T1 ILIT").spawn(this.numPages,false, false);
           this.getTemplate("RVW-T2").spawn(this.numPages,false, false);
 
          break;
      case "Mortgage/Note/Loan":
           this.getTemplate("RVW-T1 MNL").spawn(this.numPages,false, false);
           this.getTemplate("RVW-T2").spawn(this.numPages,false, false);
 
          break;
      case "Real Estate":
           this.getTemplate("RVW-T1 RE").spawn(this.numPages,false, false);
           this.getTemplate("RVW-T2").spawn(this.numPages,false, false);
 
 
          break;
    }
 
} else if (numPages > 1) {
 
     this.deletePages(1, this.numPages-1);
 
}

Please let me know if you need any more information

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 22, 2023 Aug 22, 2023

I have found what causes the "Bad parameter." message to pop up and why it only happens sometimes. The trigger drop down field is toward the bottom of page 1. If the user is makes the new selection when a portion of the next page is showing (in this document, the next page would always be a spawned template page), the "Bad parameter." message pops up. If only page 1 is showing, then the message does not pop up. In both cases, the form deletes/spawns the correct pages. Now that we know what is causing the issue, is there any way to prevent the "Bad parameter." message from popping up so that the end user will not be confused/concerned?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 23, 2023 Aug 23, 2023

May be that the bad parameter is at one of the template pages.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 23, 2023 Aug 23, 2023

Try this script, I added 2 lines at the beginning to display only the first page before its execution:

 

if(event.willCommit)
{
this.pageNum = 0;
this.zoomType = zoomtype.fitP;

switch(event.value)
{
case "Closely Held Business":
this.getTemplate("RVW-T1 CHB").spawn(this.numPages,false, false);
this.getTemplate("RVW-T2").spawn(this.numPages,false, false);

break;
case "ILIT":
this.getTemplate("RVW-T1 ILIT").spawn(this.numPages,false, false);
this.getTemplate("RVW-T2").spawn(this.numPages,false, false);

break;
case "Mortgage/Note/Loan":
this.getTemplate("RVW-T1 MNL").spawn(this.numPages,false, false);
this.getTemplate("RVW-T2").spawn(this.numPages,false, false);

break;
case "Real Estate":
this.getTemplate("RVW-T1 RE").spawn(this.numPages,false, false);
this.getTemplate("RVW-T2").spawn(this.numPages,false, false);


break;
}

} else if (numPages > 1) {

this.deletePages(1, this.numPages-1);

}


Acrobate du PDF, InDesigner et Photoshoptographe
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Aug 23, 2023 Aug 23, 2023
LATEST

Thank you for your help. Unfortunately, this does not eliminate the problem. If the user's screen is showing any portion of the next page, the "Bad parameter." message still pops up. As before, the proper pages are deleted/spawned, even with the message popping up.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines