Expand my Community achievements bar.

Newbie needing help creating events in form

Avatar

Level 1

Hi guys

First of all, I apologise if I've posted this in the wrong space. If I have could someone please point out where I should ask this question.

What I've currently got

A service contract that will be used across at least six different offices. It is an editable pdf form and I'm quite happy with it's current functioning and layout. There are two options to this agreement - Option A and Option B

What I need it to do

I need parts of it to change depending on the option chosen.

1) When the user (branch manager or representative) ticks their location, it alters the form to show the appropriate branch information.

2) I'd like when the Option A button is checked for the page to change with details pertaining to this option. The option B is irrelevant and we don't want to see it at all.

And vice versa - when Option B is checked, we'd like the form to bring up the information about option B

Help required

First of all, is this at all possible to do?

Does anyone have any videos, tutorials or even template forms they could recommend to help with this?

Any comments are much appreciated!!

Thanks

Jess.

8 Replies

Avatar

Level 10

Hi Jess,

Sounds like you are in the right place and the behaviour you want is possible.

First thing to work out is how the PDF was originally created. Editable PDFs can be created in Acrobat (tend to be called AcroForms) or in LiveCycle Designer (called XFA forms). In both cases you can script to make objects visible/invisible, however there is greater flexibility in LC Designer.

Do you know how the original PDF was created? When you open the existing form and go to File > Form Properties, it should tell you in the Description tab:

Acrobat1.png

Hee is an example using a dropdown to change the presence. https://acrobat.com/#d=txGF4IAoqmfTKPrLkwybIA

Initially I have both options visible, so that you can see the effect of make a selection from the dropdown. You will notice that the first group, the appropriate option is hidden, but that the visible option stays in its position. This is because it is in a positioned subform.

In the second example, when option A is hidden, option B moves up to take its place. These are in a flowed subform.

Please note that the form has to be saved as Dynamic XML and there are some setup work that needs to be done to get it working the way you want it.

I hope that this helps,

Niall

Avatar

Level 1

Hi Niall

Wow, that example form is great. It will definately get me started.

I made the original form using Live Cycle Designer 8.0, and whilst I've had a warning about compatibility when opening your form, everything seemed to work as intended (or as far as I can tell it did).

How about if we didn't want the customer to know there were two options? As this will be filled out by a sales rep and handed over for signing, it would be great if the drop down menu could dissapear once an object is selected. To do this would I just play around with the visibility function?

Thanks again

Avatar

Level 10

Hi Jess,

The form was set to a Target version of v9.0 in the File > Form Properties > Defaults tab:

Parallels Desktop1.png

If you change the target version (its good to check this anyway), just look in the Warnings tab to see if there are any conflicts that you would need to change before sending out the form:

Parallels Desktop2.png

Actually the error that is shown there is not a versioning problem but an error in how the nested subforms are set up - must correct that ;-)

A cool trick (from Kingphysh) is to have a hidden subform that becomes visible when three fields are given set values. This hidden subform could then contain choices for the sales team. When they are finished they would close the subform and then save and send out.

Example is here: https://acrobat.com/#d=YFdtzhiH6sI2zwCADuN1Tw

Acrobat1.png

Good luck,

Niall

Avatar

Level 1

Thanks again Niall. Are you making these templates on the fly, or have you got a bunch stored somewhere?

I guess I'm still struggling to address my main problems, which are:

1) Getting the Branch information to appear through one simple click

- The way I have it currently set up, the Sales Rep must type in his details, which seems the same as using the secret field?

- I understand the idea of having a drop down down box triggering an the event... the only problem with this is that once the document is printed, you can see the drop box and it does not look as professional.

Unless there's any way to change this?

2) Options Dialog boxes - hiding options once selected, having no white space in form

- The form you've shown me is great, however the boss has requested that the customer does not see that there is more than one option. I'm not quite sure I understand how to hide the drop down box?

- How do I make sure there's no white space? The details for both options take up the same space - about 1/4 page. I just wish for that quarter to be replaced with one or the other option. (I've seen you've given the two options here - sorry!!)

P.S

Sorry to be a royal pain in the butt! You've been a tremendous help already. The thing with Sales people and Sales Managers - They seem to be allergic to any sort of paperwork, are very impatient, and want everything handed to them on a silver platter

Avatar

Level 1

Thanks again Niall. Are you making these templates on the fly, or have you got a bunch stored somewhere?

I guess I'm still struggling to address my main problems, which are:

1) Getting the Branch information to appear through one simple click

- The way I have it currently set up, the Sales Rep must type in his details, which seems the same as using the secret field?

- I understand the idea of having a drop down down box triggering an the event... the only problem with this is that once the document is printed, you can see the drop box and it does not look as professional.

Unless there's any way to change this?

2) Options Dialog boxes - hiding options once selected, having no white space in form

- The form you've shown me is great, however the boss has requested that the customer does not see that there is more than one option. I'm not quite sure I understand how to hide the drop down box?

- The script I stole from your form (sorry) - doesn't seem to be working for me.. I'm not too sure why. I've posted it at the bottom - could you have a look? I've changed all the Option A's for Documation and B for Rental.

P.S

Sorry to be a royal pain in the butt! You've been a tremendous help already. The thing with Sales people and Sales Managers - They seem to be allergic to any sort of paperwork, are very impatient, and want everything handed to them on a silver platter

P.P.S - sorry again!!

----- form1.#subform[0].DropDownList1::exit: - (JavaScript, client) --------------------------------

switch (this.rawValue)
{
    case "Documation":
    flowedSubform.Documation.presence = "visible";
    flowedSubform.Rental.presence = "hidden"; // hides object, which also doesn't take up space
    break;
   
    case "Rental":
    flowedSubform.Rental.presence = "hidden"; // hides object, which also doesn't take up space
    flowedSubform.Documation.presence = "visible";
    break;
}

Avatar

Level 10

Hi Jess,

There are a couple of things going on here. In LC Designer there are several ways you can approach a problem. Most of them are very valid and will work well.

One option would be to make the dropdown visible on the screen only, this way it will not appear on the printout. This was introduced in version 8, so should be available to you. Select the dropdown and check out the Object > Field tab for the presence settings:

Parallels Desktop1.png

You can also get a button to go through different states and populate fields on a rotation. For example, click once for "Clonmel office", click again for "Dublin office", etc.

This will require scripting to get this behaviour.

In any case if you want to hide the button/dropdown, then you could put it in the secret place that is only accessible by the sales team. In the example the page is set to flowed so that when the secret space is visible (1/4 page) the sales team can make their selections. Then when they exit the space, the subform's presence is set to "hidden". Because the page is set to flowed, not only is the subform hidden, but the space it took up is freed so that normal objects on the form take up that space.

If you check the fields in the secret space, you will see that the binding (in the Object > Binding tab) is set to Global. This means that whatever information is inputted into these fields will automatically appear in the fields with the same name in the main form.

An example of a button is here: https://acrobat.com/#d=hEQqGFlmwvL1A5spsxVEXw

Niall

Avatar

Level 1

Duh - I've seen that 'screen only' option before! Silly me!

All this will keep me occupied for a few days at least.

Appreciate all your time and effort. Thanks a lot.

Woohoo

Avatar

Level 10

Hi Jess,

The examples are there to be used/adapted to suit your needs.

You will see that the script is making reference to objects (in this case subforms) that exist in the form. If you have these in different subforms then the script will not work. You need to make sure that the script has a sufficiently complete reference to the objects, depending on where they are relative to the dropdown/button.

A good debugging tool is the JavaScript Console (press Control+J when previewing the form). When you exit the dropdown if there are errors they will show up in the console.

Because you are scripting dynamic behaviour, the form MUST be saved as a Dynamic XML Form in the save as dialog.

Check that the dropdown does not have specify values in the Object > Binding tab, otherwise you will need to test against these in the switch statement (rather than the display values).

I hope that helps,

Niall