3 Replies Latest reply on May 27, 2011 9:22 AM by George_Johnson

    Simple Question About this.submitForm

    roc524 Level 1

      I am trying to use the following example on p.348 of the "JavaScript for Acrobat API Reference" document to "Submit the form to the server."


      this.submitForm("http://www.example.com/cgi-bin/myscript.cgi#FDF");

       

      My webhost restricts the use of CGI scripting.  Is it possible to "submit the form to the server" by submitting the FDF document directly?  Such as by: this.submitForm("http://www.example.com/myfolder/myform.fdf#FDF"); -- which does not seem to work.

       

      Note that I am trying to submit this form from within my webpage.  All I need is to get the FDF form up to a folder on my webserver.

       

      Sounds simple; can anyone help?

        • 1. Re: Simple Question About this.submitForm
          George_Johnson MVP & Adobe Community Professional

          Your first example is what you need to do, but you'd only add the "#FDF" at the end if the server script returns an FDF in response. Leaveit off otherwise.

           

          The script can do the job of saving the incoming FDF to a file on the server, which is a fairly simple opertation. It then has to return a response (HTML, empty response, FDF containing a confirmation/error message, redirect, etc.)

           

          Your second example is not something that can work.

           

          Do they really not allow Perl scripts to be used?

          1 person found this helpful
          • 2. Re: Simple Question About this.submitForm
            roc524 Level 1

            Thanks for responding.

             

            GoDaddy's economy hosting plan does not allow Perl, Python, or Ruby CGI.  But that is something I will have to deal with.

             

            Please tell me how that CGI script does the job of saving the FDF file on the server.  After the CGI file is created by my website vistor submitting the form, do I then have to go in and execute the script?  Or can it somehow work without user intervention to save the FDF file?

            • 3. Re: Simple Question About this.submitForm
              George_Johnson MVP & Adobe Community Professional

              No, there is nothing additional you need to do. The CGI script is what processes the incoming data from the PDF form submission. Part of that processing is saving the FDF to a file on the server. The second part would be returning a response to the client, which is required.

               

              To clarify, when a form is submitted, a chunk of data (content) is sent by the client to the CGI program (script) on the server. The CGI program then takes the chunk of data (in this case, FDF) and does something with it. It could read the FDF contents and save the data it contains to a database, save the raw FDF to a file, do nothing at all with it, or anything else. The CGI program then has to return some sort of response back to the client, which I discussed before.