I get the same exception while trying to calculate or submit my HTML form, which works perfectly when rendered as a PDF. I can't find a solution yet, but passing in "CONTENT_TYPE=application/pdf&CONTENT_TYPE=application/vnd.adobe.xdp+xml&CONTENT_TYPE=tex t/html" allows me to use the PDF rendering mode without causing an exception in HTML mode.
BTW, I get form action 0 (submit) instead of 1 (calculate) when clicking on a button with a server-side JS script attached. The calculation is not performed, I get the submitted data back as unchanged with a content-type of text/html, when in fact it is application/x-www-form-urlencoded.
I am also getting the same issue of "Content is not allowed in prolog" when I try to submit the content format as "PDF" from the client, while, XDP format goes through. May I know, have you resolved the issue, if so, can you please post it to the forum.
We fixed this by setting the content type passed to processFormSubmission to be "application/x-www-form- urlencoded" (rather than the types suggested in the docs)