Other Button APIs

Default Buttons will Break

When using the <button> directive in HTML the default behavior type is "submit". You MUST use the phrase 'type="button"' or your button will attempt to submit the entire form to the application. This will cause an error.  An example would be <button type="button" id="mybutton">SAMPLE</button>


In addition to the File Attachment API described in Attach File Button API, you can also trigger a few other application behaviors through custom button in your form.  Those are:

Submit

This will trigger the package submission without using the application level submit button.  This is required if you are hiding the Forms inMotion application toolbars such as in an anonymous form environment.

Submit button
<button type="button" data-submit="" id="[something]">Submit Package</button>

Approve

This will trigger the package approval without using the toolbar approval button.

<button type="button" data-approve="" id="[something]">Approve Package</button>

Reject

This will trigger the package rejection without using the toolbar reject button.

<button type="button" data-reject="" id="[something]">Reject Package</button>

Scan

This triggers the scan document behavior.  This requires the use of the Forms inMotion desktop scan listener client installed in advance on the desktop and a TWAIN compatible scanner.

Submit button
<button type="button" data-scan="" id="[something]">Scan</button>

Previous Form in Package

This moves the application to the previous form in the package.  If you are already on the first form in the package, this does nothing.

Submit button
<button type="button" data-previous="" id="[something]">Previous</button>

Next Form in Package

This moves the application to the next form in the package.  If you are already on the last form in the package, this does nothing.

Submit button
<button type="button" data-next="" id="[something]">Next</button>

Download Specific Form in Package

This one requires a bit of additional explanation.  In the scenario where you are using a coversheet to control user filling out behavior and data quality, you may still wish to map your data into a PDF form at submission time.  It is further a possibility that your end user will need to see that PDF version of the data as well.  This API allows a button to be placed on the coversheet that specified a particular form in the package to download.  Since this occurs after the mapping has been executed, this can be used to get that completed PDF version to your user.  Replace the number 1 in the sample below with the number of the form you wish to download.  This is 0-indexed

Submit button
<button type="button" data-download-1="" id="[something]">Download form #1 in this package</button>