Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

HTTP submit button

Avatar

Former Community Member
Hi all,



I am new to designer and am working to change our static PDF files to interactive ones. The goal would be for a user to fill out the form then submit it to our website, which would place it in a database. I am running IIS 5.0 and have used ASP, but am not sure what form the PDF information will take or how to make use of it. Any suggestions or hints would be very appriciated.



Casey
15 Replies

Avatar

Former Community Member
You can have it submit an XML structure, or post the data as if it was a web form (then the field names in the form become the form keys).



If you have it post the XML structure, the XML structure is posted in the body of the request.

Avatar

Former Community Member
Joseph,



Thanks for the reply. After much web searching on Wednesday (and more frustration than I care to remember) I found out that when the PDF is uploaded via the POST button, it sends its information in an annoying format. The best way to find how to get it is to do a request.form() with nothing in the parathesis, that way it pulls everything that is being sent to the page. (Be sure to output this). Then do a search for the name of the form box you are trying to retrieve info from. It will list the form name and subsection before it with lots of "%" (Its UTF-8). Copy the stuff before the field you want as well as the field name and that should reference it correctly to pull the given user information.



If anybody knows of a simpler way to do this I would be happy to hear it, but for now it seems to be the only way to get the user input.



Casey

Avatar

Level 7
Casey,



What is this annoying format - what are the first few lines?

What format did you choose to submit in?



Aandi Inston

Avatar

Former Community Member
Aandi,
<br />
<br />I submitted using the HTTP submit button (HTTP Post). I told it to submit to an ASP page. (code below).
<br />
<br />
<br />
<br /><%<br />response.write(request.form&"<p>")<br />response.write("Name: "&request.form("thePage%5b0%5d.theSubform%5b0%5d.Name%5b0%5d"))<br />%>
<br />
<br />
<br />
<br />The first request.form will display all of the info that is being sent to the page. It was how I finally figured out how to get my data.
<br />
<br />The second request.form has the format I was refering to.
<br />
<br />Casey

Avatar

Former Community Member
Hi folks,



I seem to be having a similar problem... I'm using Adobe Designer 7 to create a form and submit it to a script on my web server, where I will capture the POSTed data. I'm experimenting with target scripts written in ColdFusion MX and PHP 5.



I too get POST data in an "annoying format," and had to dump it out as a lump to figure out what was going on. Normally, I'd have access to form field values by referencing them like so, in ColdFusion and PHP respectively:



#form.myfieldname#

$_POST["myfieldname"]



The fieldnames I get from the Acrobat form looks like this:



FORM1[0].MYFORMNAME[0].MYFIELDNAME[0]



ColdFusion will allow me to get at the field value by using this as a key, but PHP chokes--it seems to interpret the POST data as an array with a single, apparently empty element.



I've made sure that the Acrobat form's submit button is configured to send POST data, and I've tried every manipulation I can think of to get it to send differently. Am I doing something wrong? Is there a way to clean this up?



TIA,



Nick.

Avatar

Former Community Member
Nick,



I haven't played with PHP too much, but when I did my correction with ASP I used the entire FORM1[0].MYFORMNAME[0].MYFIELDNAME[0] as my field name (ie. $_POST["FORM1[0].MYFORMNAME[0].MYFIELDNAME[0]"]). Not sure if it will work for PHP as well or not. My understanding of how it all works is as follows. When you do a form request, you can have multiple items in the "NAME" field and such. For ASP the actual format for a request.form includes a spot for the number.



Syntax: Request.Form(Element)[(Index)|.Count]



Usually people don't choose to have multiple items and the shorter notation works just fine.



I guess what it is coming down to is that Adobe made Designer include as much data as possible so you could have multiple sections with the same field name.



One other suggestion I might have (after a quick browse of devguru) is to try a $_GET. It doesn't make much sense that you should have to use it, but I figure I'll throw it out there.



Casey

Avatar

Former Community Member
Thanks Casey,



I've tried your first suggestion already, and as I said above, it works in CF but not in PHP. PHP just doesn't find anything in its $_POST scope except an array called FORM1 containing, apparently, another empty array called 0.



Using $_GET would only work if there's a way to tell an Acrobat form to pass the form data in a query string. I haven't run across a technique to do that, and I've been reading everything I can find about how to do this ;-)

Avatar

Former Community Member
Ok. I thought that was probably the case, but figured I would give it a shot. This is where I wish there was some easy way to ask Adobe. Keep us updated if you find anything.



Good luck,



Casey

Avatar

Former Community Member
This topic is exactly what I need to do ... BUT ... I'm lost with your examples. I posted the below info into its own topic but maybe you can answer it. Could you Email me the PDF form and the CFM page that the form calls so I can see the exact code you did? I would be forever greatful. Here is my post I did earlier:



The user fills a field on a form - the Objects Name (under the Object / Binding / Name:) is txtName. I have a submit button with type of Button and the Object / Submit / Submit Format: is URL-encoded Data (HTTP Post) and the Submit to URL: is pdfMembershipFees.cfm



Within the pdfMembershipFees.cfm HTML page I was to access the value that the user typed in the txtName field. How do I do that? Is there a simple example of the pdf form and a HTML page (I would prefer a Coldfusion (cfm) page but an asp version would do) that work together and just display the value on the screen from the HTML page.



This is pretty urgent so thanks for answering promptly.

Avatar

Former Community Member
Tim,



I've never worked with coldFusion, but I will be happy to send you my ASP stuff. I am on vacation for this week, but when I get back into the office monday, I will send them to you.



If you don't hear anything from me by Tuesday, just fire me an email, it means I probably got roped into some project or meeting.



Casey

Avatar

Former Community Member
Casey,



Thanks. That will probably help a lot. I haven't did much research on this but maybe you know. Is there a way to do a "silent" print? Because here what I'm currently working on. I manage a web site for my race club and I switched over to Acrobat forms and also in the mist of this I have to change over to ASP from CF and I don't know anything about ASP but I'll learn. I have two buttons on the registration form one for Send via Email and the other one is Pay via PayPal. I want to do a "silent" Email and set a flag and then test the flag during the Pay via PayPal button process so I can guarentee that they did the Send via Email before they do the Pay via PayPal.



Thanks for everything.



Tim

Avatar

Former Community Member
Tim,



What is the silent email for? I ask because you cannot send something from the user's computer without their knowledge (email, file, etc). This being for security reasons. If you tell me a bit more about the process I will be happy to try and point you to a work around.



Casey

Avatar

Former Community Member
There is a command in CF called cfmail and if a user click a button then you can send the Email without any user interaction or message. And actually they aren't aware that an Email was sent except they clicked on a button that said we were sending the registartion stuff via Email so yes I could send an Email and no one would be the wiser if I wanted too. I use this to send the current registration stuff but it is just a format Email message (not an attachment) and the Email server that it uses is the club's own Email server. I also use it to transfer basic info to the correct person when they click the Pay for PayPal info to tell them that a user started the PayPal process but there is no guarentee that it was completed.



In the current case I want to have just one button that will send the registration info AND go directly to PayPal for them to pay and I can guarantee the info is the same on both the registration form and the PayPal info.

Avatar

Former Community Member
Tim,



That you can do. I think a quick google search will give you some code to use. (I would give you my stuff, but it has a bug or two at the moment). Anyway, I have my example files for you, is there an email address where I can send them to you?



Casey

Avatar

Former Community Member
Thanks Casey. Please use Owner@TBSenterprise.com