Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

HTTP Submit data not being posted

Avatar

Former Community Member
My form has an HTTP Submit button with a url that 'works' (when I click submit, it goes to that url) except the data doesn't get posted. I've tested the url and it does receive data posted to it via a regular html form. I assume the PDF form data field names are defined by their Binding names. What else do I have to do to get the data to actually be posted to the url?
28 Replies

Avatar

Former Community Member
Hmm.. how are you checking to see that the data gets posted? I've tried HTTP submit and had no problems with it...



Update your submit URL to this one temporarily:



http://stevex.net/dump.php



And try submitting, and see what you get. That URL will dump out all the variables that are posted - maybe the names of the fields aren't what you're expecting, or something like that.



If that doesn't help, can you post the form you're having trouble with?



--

SteveX

Adobe Systems

Avatar

Former Community Member
Steve:

Can you post your PHP code for that page?



Thanks,



Mike



Mike Potter

Developer Relations

Adobe Sytems Inc.

Avatar

Former Community Member
Nevermind, it appears as though that behaviour has changed in Designer 7.1. With a PHP script, you can now simply dump out the $_POST variable and retrieve an array of form variables.



I don't think you could do that with Designer 7.0.



Mike

Avatar

Former Community Member
Is there a difference in what gets posted when the form is created in 7.1 vs 7.0?



With both 7.0 and 7.1 when I hit Submit with dump.php as the URL, I see the fields I added and the values I typed into them as posted data.



--

SteveX

Adobe Systems

Avatar

Former Community Member
My form is at http://www.auburn.edu/~henryla/adobeFormTest.pdf now submitting to SteveX's dump page instead of my PHP script.
<br />
<br />Here's what SteveX's dump page showed:
<br />
<br />Request Variables
<br />
<br /> * [form1] = Array
<br />
<br />And here's my PHP code that didn't work:
<br />
<br />
<br /><?php<br /><br>$To = $_POST["to"];<br /><br>$Sub = $_POST["sub"];<br /><br>$From = $_POST["from"];<br /><br>$Name = $_POST["txtName"];<br /><br /><br>echo &quot;Hello, &quot;.$Name.&quot;<br />&quot;;<br /><br>echo &quot;Subject: &quot;.$Sub.&quot;<br />&quot;<br /><br>?>

Avatar

Former Community Member
I see the problem... Using the "XML Source" tab, you can see the code for your button:





The format="formdata" is incorrect, but I can't remember how to change it right now.

I added a new button, and here's what came out:





So, if you go to the source and change format="urlencoded" to format="formdata", then you should be fine. Or, just use the attached form, and submit using the bottom button.

Mike

Mike Potter
PHP Evangelist, Adobe Systems Inc.

Avatar

Former Community Member
Thanks, Mike, your post did lead to the solution but it was actually the other way around: I changed formdata to urlencoded to get it to work. It does seem clunky to have to edit the XML source directly just to get the data to post, but I'm happy. Thanks a lot!

Avatar

Former Community Member
I tried the above, and I still can't get it to work -- when I change the format value, I then receive an error: "Invalid enumerated value: urlencoded"... anyone know what might cause this error?

Avatar

Former Community Member
I am also trying to post from an Adobe Form to a PHP page and the $_POST array is empty, however, if I turn on:



; Always populate the $HTTP_RAW_POST_DATA variable.

always_populate_raw_post_data = On



in my php.ini file. In the destination page I can see:



string(111) "form1%5b0%5d.%23subform%5b0%5d.last_name%5b0%5d=ASDASD&form1%5b0%5d.%23subform%5b0%5d.HTTPSubmitButton1%5b0%5d="



via:







My questions are:



1. Will the $_POST array ever be populated or will I need to parse the raw data to get the values? In other words is the the ONLY way to read the data? Is the the intended design?



2. Is there are more elegant way to communicate with Adobe Forms using PHP?



3. Does 7.1 behave differently that 7.0. I am using the 30 day trial. We are evaluating this as a solution for our current project. Is 7.1 available in a trial version?



Thank you!



M Goodell

Avatar

Former Community Member
That's interesting - it's a different format than what I'm seeing when submitting a form using Acrobat 7.0.7.



When I submit, any subforms I have are simply not included - it could be that we changed this to not submit the full path to the field but rather just the top level fields to get around a problem like this, but I'm not familiar with that if we are...



The version of Designer doesn't matter in this case, since it's Acrobat or Reader that's actually forming the POST - what version of Acrobat are you using?



Another way to get data from a form to a back end is to use SOAP. I'm not familiar with the server side of SOAP using PHP but if you can figure that out, it can let you do much richer things in your form than an HTTP Submit can do.

--

SteveX

Adobe Systems

Avatar

Former Community Member
stevex,



I am using Adobe 7.0.0 (30-day) eval. Is there are newer version available for demo purposes and does it behave differently?



I would still like to know, should the $_POST array be filled or do I need to read raw post data is we go that route?



Also, we would like to perform bi-directional communications with the forms if possible. Is SOAP the preferred way to acomplish this?



Where would one look to quickly learn how to do it. I am somewhat familiar with SOAP and could figure it out. PHP support for it is fairly good from what I have read.



Thanks again!

Avatar

Former Community Member
The $_POST array should be filled.



Yes SOAP would be the way to do bi-directional communications; HTTP Submit is designed for sending the results of filling out the form back to the server, SOAP is the way to make calls to the server to, for example, fetch data to populate combo boxes dynamically based on other input.



The 15 second SOAP tutorial is:



- Launch Designer, create a new form

- In the Data View, select New Data Connection

- Select WSDL file, hit Next

- Use http://www.ottawaevents.org/echo.asmx?WSDL as the WSDL

- Select the EchoString operation, Finish



Three things will show up in the Data View: EchoString Request, EchoString Response, and EchoStringBtn. These are the parameters, the reponse, and a trigger button. Drop each of these onto the form, and then hit Preview. Type something into the request field, hit the submit button, and you should see (after a round trip to the server) the string show up in the response.



I've attached a simple form that does exactly this.

--

SteveX

Adobe Systems



--

SteveX

Adobe Systems

Avatar

Former Community Member
SteveX,



Thank you for you help on this. I will look into the SOAP option.



Is the $_POST problem I am having considered a bug with 7.0.0? If so, should I contact sales to see if we can demo the newest version and see if there is a difference? Or could this be a PHP / Adobe config issue.



Thank you again,



Michael

Avatar

Former Community Member
SteveX,



Two things:



1. When I create a form using my 7.0.0 version of Adobe attempting to demonstrate what you recommended in post item #12 it does not work. However, if I use the form you created in 7.0.7 it seems to echo the string back just fine.



2. I just spoke to, or attempted to speak to technical support regarding this $_POST issue. They informed me we would have to buy Adobe 7.0.0 then upgrade to 7.0.7 and that is my only option.



Furthermore, they advised me any further support for the trial version will need to be done through online methods. Our problem with that is we are not interesting in evaluating a defective version of the software, moreover, we are not going to buy it hoping it will work and then have to go through the hassle of returning the product if it proves to have the same problems as 7.0.0.



Finally, it seems 7.0.0 is substandard relative to 7.0.7 and several issues have been corrected in the new version. We would like to evaluate this product further however doing so with 7.0.0 is not a viable option.



So, with that said, we are open to any ideas you have.



Regards,



Michael

Avatar

Former Community Member
An FYI for everyone reading this thread:



Simply put, the 7.0.0 trial version of Live Designer is "broken and buggy" that's a direct quote from one of the Adobe personnel we spoke to on the phone.



We ended up having to purchase the product and then update it to get it to work. The odd thing is that the initial download of the purchased product (7.0.XXXXX) works fine as far as the $_POST array issue, then the upgrade to 7.0.7 breaks it again.



What we have found regarding the $_POST array not being filled is that the form generator creates the wrong code as mentioned in item #6 in this thread.



Don't expect the fix in item #6 to work in the trial version - it will only work in the latest version after you modify the XML source.



Hopefully, this helps anyone dealing with this problem.

Avatar

Former Community Member
I'm sorry your experience with it wasn't very good - did you try the Designer 7.1 trial version?



It sounds like you're using Acrobat version numbers - Acrobat comes with Form Designer 7.0, and the current Form Designer is 7.1 - there is a downloadable tryout version of that on our site.



But at least I'm glad to hear that you have it working now.. can you say what the difference is in XML between the form that works and the form that doesn't?



--

SteveX

Adobe Systems

Avatar

Former Community Member
SteveX,

The version of Live Designer we have is: 7,0,041126,0 and the bug seems to be contained in a template file: HTTP Submit Button.xfo
Line 36 of this file is:



when it should read:



The different code produced by this is as follows:

INCORRECT:


CORRECT:


I modified my template file and now it works properly.

Avatar

Level 1
Try this:
Quit Designer
Browse to C:\Documents and Settings\[user]\Application Data\Adobe\Designer\en\objects\standard
Open HTTP Submit Button.xfo in notepad
Edit line 36 to read

Launch Designer
Create new form
Insert HTTP Submit button
Check the XML for that and it should have "urlencoded" on the "submit" line

Avatar

Former Community Member
You can also change this from with the Designer UI - drop a button on the form, set the execute action to Submit, and a Submit tab will appear in the Object Inspector, where you can select from the various ways the data can be encoded on submit.



"formdata" isn't even a valid value, I'm surprised we had that as the default - but I can see it's fixed now. Sorry for the inconvenience there.



--

SteveX

Adobe Systems

Avatar

Former Community Member
I cannot find 7.1 for the life of me on Adobe's site!