Copy link to clipboard
Copied
In https://helpx.adobe.com/acrobat/using/setting-action-buttons-pdf-forms.html you can read:
When you distribute a form, Acrobat automatically checks the form. If it doesn’t find a submit button, it adds a Submit Form button to the document message bar. Users can click the Submit Form button to send completed forms back to you. If you don’t plan to use the Submit Form button created by Acrobat, you can add a custom submit button to your form.
I added a Submit button to my form but when I distribute the form I get two submit buttons: the one I added plus the one in the standard purple banner as shown below:
So despite my submit button, Adobe Acrobat still created its own. Any explanation?
The only reason for me to add my own submit button was to do some validation before submitting the form.
In fact, I would like to have a submit button with the following JavaScript code:
if (FormOk()==true) {
var nButton = app.alert({
cMsg: "Do you really want to submit this application form?",
cTitle: "Submit form",
nIcon: 2, nType: 2
});
if ( nButton == 4 ) {
// Submit form to UNC
this.submitForm({cURL: "\\SERVER\SHARE\", cSubmitAs:"PDF"});
app.alert({
cMsg: "Your application has been submitted",
cTitle: "Submit form",
nIcon: 3});
} else {
app.alert({
cMsg: "Your application was NOT submitted",
cTitle: "Submit form",
nIcon: 3});
}
}
This would validate the data entered (code for FormOk function not included) and if everything is Ok then would ask the user for confirmation before submitting the form.
Thanks in advance!
Copy link to clipboard
Copied
I figured the whole thing out and everything is working as I wanted so I am sharing the solution with everybody.
I got the purple banner disabled by doing the following:
I then re-opened the form, re-distributed it and this time, like magic, Acrobat recognized my custom Submit button and went through the usual dialogs for creating a distribution workflow. The distributed form does not display the purple banner and my submission workflow works flawlessly.
Summarizing:
All this have been tested using Adobe Acrobat DC
Copy link to clipboard
Copied
Don't use the Distribute command. Simply send out your form with the button
you added.
Copy link to clipboard
Copied
Thanks for your reply.
Without distributing the form, I would not get a workflow for collecting the responses. Would I have to implement my own "Tracker" app? Sounds like re-inventing the wheel.
Copy link to clipboard
Copied
Big problems here.
To to start with you have a "Submit URL" which is not a URL. It's a Filename. "submit" requires an actual URL, using the http, https or mailto protocols. SUBMIT DOES NOT MEAN SAVE. Reliable workflows use https or http and use a script written by a web programmer.
Second, if you want to use track this has to do the submit. You can't have it both ways. Tracking isn't different.
Copy link to clipboard
Copied
You are absolutely right! There are big problems but with your reply.
I never mentioned that my form had not worked but just that I have ended with two Submit buttons despite Adobe Acrobat documentation stating:
“When you distribute a form, Acrobat automatically checks the form. If it doesn’t find a submit button, it adds a Submit Form button to the document message bar”
From Adobe Acrobat User Guide, “if you distribute a PDF using your own server location, you can specify a network folder, a Windows server running Microsoft SharePoint Services, or a web server folder”.
I am pretty aware of the fact that SUBMIT DOES NOT MEAN SAVE and that’s exactly why I wanted the SUBMIT functionality which creates a form distribution & data collection workflow.
The Form Distribution Wizard allows you to specify a UNC for the network shared folder as shown below:
So despite the submitForm page in the JavaScript API not mentioning the possibility of using a UNC, my instinct suggested me to test using a UNC instead of a URL which, to my satisfaction, worked as I expected.
In my original post I wrote \\SERVER\SHARE\ which is the Windows notation for a UNC (not a filename) however in Adobe Acrobat, as in UNIX/LINUX, you must use forward slash and write //SERVER/SHARE/ instead.
The custom Submit button in my test form (TEST1.pdf) has the following script associated to the MouseUp event:
// TEST1: UNC
var nButton = app.alert({
cMsg: "Do you really want to submit this application form?",
cTitle: "Submit form",
nIcon: 2, nType: 2
});
if ( nButton == 4 ) {
// Submit form to UNC
this.submitForm({cURL:"//RNAS/DB/TEST/", cSubmitAs:"PDF"});
app.alert({
cMsg: "Your application has been submitted",
cTitle: "Submit form",
nIcon: 3
});
} else {
app.alert({
cMsg: "Your application was NOT submitted",
cTitle: "Submit form",
nIcon: 3
});
}
When filling the form, clicking the custom Submit button worked as shown below:
After clicking Yes:
After clearing the checkbox and clicking Allow:
The weird part, which was the reason of my original post, is that despite having a custom Submit button in the form, Acrobat generated its default Submit Form button in the purple banner which also worked the usual way.
After that you can see both responses in Tracker:
Similar results are obtained using the equivalent URL as in:
this.submitForm({cURL:"smb://RNAS/DB/TEST/", cSubmitAs:"PDF"});
As you can see, reliable workflows can also use smb protocol. Keep in mind that most small businesses outsource their web services but they still have an onsite file server using CIFS hence the value of this distribution method.
BTW, in my 30+ year career in IT, many times I have found undocumented features and/or things that don’t work as documented.
Unfortunately, my issue still needs a solution and I have been thinking that it may be that I simply need a way to hide Adobe’s default Submit Form button.
Copy link to clipboard
Copied
I realize this post is a bit old, but it is the closest thing to what I've been looking for. Regarding the file path you have in your javascript, is that the location where the "..._distributed.pdf" file resides once a file has been distributed? No matter what I try and use for a file path I can not get this javascript file to do anything once I hit the submit form button. I do see the "Send Form" dialog box appear and I can hit send, but after that nothing happens.
Any help would be greatly appreciated.
Thanks, Steve
Copy link to clipboard
Copied
Then don't use the distribute mechanism. That is done by submitting the file, you can't have it both ways. Or, remove your custom submit button. Tracking is NOT a side effect of the submitForm method.
By by the way, does your attempt to do submitForm to a file write the file? I know it says the submit succeeded but that's just because you put that message out.
Copy link to clipboard
Copied
You still don't get it, I want the workflow!
Adobe default Submit Form button is limitted. With my custom button I can do whatever I need (complex validations included) before submitting the document
Sure Tracker is not a side effect of the submitForm method but the distribution workflow IS which means:
NO SUBMIT = NO WORKFLOW
DId you read that both responses from my custom submit button and from Adobe Submit Form button went to Tracker?
Two different response files.
Copy link to clipboard
Copied
I don't think Adobe offer the workflow you want but I'd be delighted to be corrected.
Copy link to clipboard
Copied
Adobe has the workflow I want, the issue is with something not working as documented. The documentation says:
"When you distribute a form, Acrobat automatically checks the form. If it doesn’t find a submit button, it adds a Submit Form button to the document message bar."
My form has a Submit button but Adobe still adds its own. Is it so difficult to get my point?
I don't expect a solution from Adobe until the next update. BTW do you know how frequently they release updates?
At this point I am thinking about a small hack. I am going to try to find out the name of the Adobe Submit Form button and disable it when the form is opened.
Copy link to clipboard
Copied
You use a button with javascript action, not a button with submitform action.
Copy link to clipboard
Copied
What would be the point of adding my own Submit button if it is going to use only for a Submit function?
That would be kind of re-inventing the wheel.
But I think I get your point, I am re-testing right now with my button including Submit a form as an action
Copy link to clipboard
Copied
Same result. The distributed form got two Submit buttons:
Both buttons worked Ok and I got the responses on Tracker as shown below:
Copy link to clipboard
Copied
I figured the whole thing out and everything is working as I wanted so I am sharing the solution with everybody.
I got the purple banner disabled by doing the following:
I then re-opened the form, re-distributed it and this time, like magic, Acrobat recognized my custom Submit button and went through the usual dialogs for creating a distribution workflow. The distributed form does not display the purple banner and my submission workflow works flawlessly.
Summarizing:
All this have been tested using Adobe Acrobat DC
Copy link to clipboard
Copied
Thanks for this, I couldn't find any other place that went through how to fix this. The extra submit button was doing my head in!
I was wondering if you still had the "send form" window pop up when you submit? I'd like this to go away and just add the response to the distributed response form, but not sure how I can hide this (see the window below).
Thanks
Copy link to clipboard
Copied
Hello,
I have used your JavaScript in the Submit botton to a UNC path successfully on PC. However, it does not work on any tablet with iOS or Android. Would you have any recommendation?