These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Multiple submit buttons

Runolfr
Registered: Oct 1 2008
Posts: 119

I have a form that I am trying to adapt to a process flow. The initial requester fills out the form and then clicks a button with a control-type of "Submit" and a "mailto" URL. A script in the preSubmit event sets the email address and subject line. It also protects most of the forms fields, but it opens a set of approval fields.

The approval fields include another submit-type button with its own preSubmit script. Clicking the approval submit button is supposed to send the form to the next person in the approval chain.

In total, there are three submit buttons.

Apparently, clicking the first submit button causes all three preSubmit scripts to run, which is a problem for which I have yet to come up with a solution.

cotatidave
Registered: Nov 18 2010
Posts: 4
Have you ever found a solution to this?
DaveyB
Registered: Dec 10 2010
Posts: 70
There are several possible solutions to this problem, this is just one:

Scenario: I open a form for a leave application, which must be approved by my direct manager, and also by my bosses manager. The form contains fillable fields and an email button (possibly with a dropdown list to select my manager from).

Implementation: The form is designed as specified above, and is not saveable (printing is enabled if desired). There is a hidden numeric field on the form, called "ManagerLevel", with a default value of 0 (zero). This field is incremented automatically on clicking the email button, which also closes the form (preventing further increments at the same level). Scripts in the form check the current level of this field and enable or disable parts of the form based on the current level.

In use (User): I open the basic form, ManagerLevel is set to 0, so I can fill in my request information. Once it is ready, I print off a copy for my records, then select my Manager from the list and click the "email" button. A popup asks if I have already printed a copy and offers to do so, then sends the form via email to my manager. At this point, ManagerLevel is incremented by one, and the form is closed once the email send is completed.

In Use (Manager): I receive an email from an employee containing the PDF form. I open it up and, since ManagerLevel is set to 1, it enables the fields I need to use to approve or disapprove the request, optionally disabling other fields that I don't need to mess with (originator name, employee ID and the like). The same submit button is visible but unusable until I select the (approved/denied) checkbox, at which point it will send the email to "the big boss" or the "originating employee". Assuming the request is approved, the form is forwarded to "Da Boss", and once again the "ManagerLevel" is incremented, throwing in the print options as required and closing the form after sending.

In Use (Da Boss): I receive the form with the "ManagerLevel" now set to 2. This opens up the approval fields I need to use and locks out the other unneeded fields as required. The originating employee and their manager are already coded into the form, so I simply need to select approved/denied as required and hit that same submit button again (with optional print prompts), sending the response back to the employee and a copy to their manager.

This is a fairly simplistic overview, involving minimal coding, and illustrates one method of achieving the desired results. There may be better ways of doing the same thing, and this method is certainly very easy to circumvent. I leave it to your imagination and practical experience to decide on your best solution.

I hope that this is helpful! (and that the forum software doesn't take out all my paragraphs like it normally does!)

DaveyB

LiveCycle Designer 8.0
"Genius is one percent inspiration, ninety-nine percent perspiration." ~~ Thomas Edison
"If at first you don't succeed, get a bigger hammer." ~~ Alan Lewis
"If the conventional doesn't work, try the unconventional" ~~ DaveyB

cotatidave
Registered: Nov 18 2010
Posts: 4
This all sounds great I would like to do something along these lines. Is it possible for to send me a template of your form?

DaveyB
Registered: Dec 10 2010
Posts: 70
Sorry, this "form" only exists in my head, based upon what is possible within the application, and my experience using the application. My post was intended to stimulate the creativity of the reader, rather than providing "potted" solutions, and simply outlines a possible approach.

LiveCycle Designer 8.0
"Genius is one percent inspiration, ninety-nine percent perspiration." ~~ Thomas Edison
"If at first you don't succeed, get a bigger hammer." ~~ Alan Lewis
"If the conventional doesn't work, try the unconventional" ~~ DaveyB