Highlighted

Show some instructions/information when/if a specific value is selected from a drop-down.

LCUser69

23-12-2014

Hello,

I want to show the user filling out a PDF form some instructions (or some information) if/when they select a certain value from a drop-down. The information is more than the app.alert or FormCalc's message window will show. Is there a way to have a PDF form "popup" via JavaScript? I want the instructions to be part of the fillable form but don't want it to print if they print the form and shouldn't be visible until if/when they select the value. I can show/hide fields on the form via JavaScript but cant seem to figure out how to show another form (or another page on the form that is by default not visible). Or is there another way to go about this? Any example PDFs you can point me to, so I can see the functionality?

Thank you in advance!

UPDATE:

I finally figured it out. After all, it was fairly easy to do. Here is some detail in case someone else is looking for the same thing.

1.) The form must be saved as a "Adobe Dynamic XML Form (*.pdf)" not a "Static PDF Form (*.pdf)".

710545_pastedImage_2.png

2.) The "main" form must be a "flowed" form with the "allow page breaks" checkbox checked.

710546_pastedImage_3.png

3.) The "instructions" form to display is placed on the "main" form as a subform with whatever content you want on it.

4.) The "instructions" forms "presence" set to "Hidden (Exclude from layout)".

710547_pastedImage_5.png

5.) Use code to show or hide the "instructions" form. To show the "instructions" form set the forms presence to "visible". To hide the "instructions" form set the forms presence to "hidden". You can also put a button the "instructions" form to close (hide) the form. Setting "relevant" to "-print" will keep the subform from being printed.

Place this code in the "exit" event for the drop-down

switch(this.rawValue) {

case 'Show':

  form1.frmMainForm.frmShowHideContent.presence = "visible";

  form1.frmMainForm.frmShowHideContent.relevant = "-print";

  break;

 

case 'Hide':

  form1.frmMainForm.frmShowHideContent.presence = "hidden";

  form1.frmMainForm.frmShowHideContent.relevant = "-print";

  break;

}

Put this code in the "click" event for the button

this.parent.presence = "hidden";

this.parent.relevant = "-print";

6.) If you are submitting the data on the main form and do not want to submit the "instructions" form's data then set the binding to "no data binding" for the subform.

710548_pastedImage_15.png

Subform not displayed:

710549_pastedImage_18.png

Subform displayed:

710550_pastedImage_19.png

This is a much better option than using the FormCalc's message window and the app.alert. It is just another form so you can put whatever content you want on it, images, text, labels, etc,, When the subform is displayed all of the content on the main form is just moved down. When the subform is hidden all of the content on the main form is moved back into its original position.

Hope this helps someone. I searched and searched for this functionality on the web and couldn't find anything..