18 Replies Latest reply: Apr 6, 2012 5:50 PM by dkfsbo1 RSS

    Submit button error message

    dkfsbo1 Community Member

      I have created a 26 page fillable form using adobe acrobat x pro.  I tried to put the submit button on but every time I hit it - it says "at least one required field was empty. Please fill in the required fields (highlights) before continuing.  I have hundreds of fields and I do not think I selected any as required - I just made some boxes red so folks would fill those out.  There are digital signature boxes as well.  Is there a way for me to see what it is looking for or to somehow by pass and make the submit button work to send me the PDF?  Spent two weeks putting this form together and I am so close. Please help.  Thanks deb

        • 1. Re: Submit button error message
          George_Johnson ACP/MVPs

          Add a button to your form and place the following code in the Mouse Up event. It will print a list of required fields to the console, along with the page numbers. You can then remove the button when you get things straightened out.

           

           

          // Mouse Up script for button
          for (var i = 0; i < this.numFields; i++) {
          
              var fn = getNthFieldName(i);
              var f = getField(fn);
          
              if (f.type !== "button" && f.required) {
                  console.println("Field name: " + fn + " on page(s): " + f.page);
              }
          }
          
          console.show();
          
          • 2. Re: Submit button error message
            George_Johnson ACP/MVPs

            Also, note that the page numbers are zero-based, so fields on the first page will show as page 0, etc.

            • 3. Re: Submit button error message
              dkfsbo1 Community Member

              Thank you so much for a quick response.  This is my first form and I do not know any java, etc.  I am sorry to ask even more help from you but I am just learning all this - I added the button and the select trigger says mouse up - what is the select action suppose to be (run a java script?) and do I change anything under options ie currently - Label only and behavior is currently invert.

               

              This is what i tried but when I hit the button - it didn't do anything.  Thanks so much for your time.

              • 4. Re: Submit button error message
                George_Johnson ACP/MVPs

                Yes, the Select Action should be "Run a JavaScript". When you click the "Add" button the JavaScript editor will be displayed and you can paste the code I showed earlier into the editor. You don't have to be concerened with any other button options. When you're done, select the Hand tool and click the button. The JavaScript console should then get displayed and it should show a list of any required fields. If it doesn't do anything, open the console by clicking Ctrl+J to see if there are any errors reported.

                • 5. Re: Submit button error message
                  dkfsbo1 Community Member

                  Control J - worked :-)  this is what is says

                  Acrobat EScript Built-in Functions Version 10.0
                  Acrobat SOAP 10.0

                  TypeError: getField("Preview") is null
                  15:Document-Level:!!DocOpened
                  TypeError: f is null
                  7:Field:Mouse Up
                  TypeError: f is null
                  7:Field:Mouse Up
                  TypeError: f is null
                  7:Field:Mouse Up
                  TypeError: f is null
                  7:Field:Mouse Up
                  TypeError: f is null
                  7:Field:Mouse Up
                  TypeError: f is null
                  7:Field:Mouse Up
                  TypeError: f is null
                  7:Field:Mouse Up
                  TypeError: f is null
                  7:Field:Mouse Up
                  TypeError: getField("Preview") is null
                  15:Document-Level:!!DocOpened
                  TypeError: getField("Preview") is null
                  15:Document-Level:!!DocOpened
                  TypeError: f is null
                  7:Field:Mouse Up

                   

                  What does this mean in layman terms?  Thanks again so much.

                  • 6. Re: Submit button error message
                    George_Johnson ACP/MVPs

                    Those errors that are reported are probably caused by code elsewhere in your form. Try clearing the console by clicking the little garbage can in the lower-right of the console window and then clicking the button you set up again. Now what does the console show?

                    • 7. Re: Submit button error message
                      dkfsbo1 Community Member

                      All is says now is:

                       

                      TypeError: f is null

                      7:Field:Mouse Up

                      • 8. Re: Submit button error message
                        George_Johnson ACP/MVPs

                        It should not do that, so I suspect something is corrupted. Try doing a Save As, close the form, close Acrobat, and try again.

                        • 9. Re: Submit button error message
                          dkfsbo1 Community Member

                          Hi George - I even shut the computer down and restarted but still get the same:

                           

                          Acrobat EScript Built-in Functions Version 10.0
                          Acrobat SOAP 10.0

                          TypeError: getField("Preview") is null
                          15:Document-Level:!!DocOpened
                          TypeError: f is null
                          7:Field:Mouse Up

                           

                          I truly appreciate your suggestions.  I used text boxes and radio buttons and datafields and digitial signatures in this pdf - do i need to extend reader rights for it to work?

                           

                          Thanks again. deb

                          • 10. Re: Submit button error message
                            George_Johnson ACP/MVPs

                            No, you don't have to do that. I'd be interesting in looking at the form if you're free to email it to me at: acroscript at gmail dot com

                             

                            It's probably something simple, but it's hard to tell without looking at the form.

                            • 11. Re: Submit button error message
                              dkfsbo1 Community Member

                              Just sent to you. THANK YOU so much for taking a look it for me.  Please let me know if you don't get it - it is a large file and I couldn't figure out how to get it any smaller without zipping it.

                              • 12. Re: Submit button error message
                                George_Johnson ACP/MVPs

                                There is a weird bug that prevents the code I posted from fully working. It doesn't recognize fields with a leading space in their names for some reason. But I was able to identify the fields that are marked as required:

                                 

                                Field name: "Lead Paint Knowledge" on page(s): 23

                                Field name: "Year Built" on page(s): 15

                                 

                                Note that the first one is a radio button, and the companion radio button is named "Lead Pain Knowlege", so you should correct this.

                                 

                                There is an additinal error associated with code in a document-level JavaScript that runs when the form is opened. It not clear to me that the code is needed though. In any case, you should look into it more.

                                • 13. Re: Submit button error message
                                  dkfsbo1 Community Member

                                  Wow - You are good.  I went through that page so many times before and didn't see that one required.  I fixed it but submit still doesn't work.  I don't know anything about document level java script.  Is there an easy way to remove the script that I can try to see if it works.

                                   

                                  Thanks George.

                                  • 14. Re: Submit button error message
                                    dkfsbo1 Community Member

                                    I did a save as and tried it again and it worked!!! THANK YOU THANK YOU.  HAVE A WONDERFUL WEEKEND!!  

                                    • 15. Re: Submit button error message
                                      George_Johnson ACP/MVPs

                                      Regarding the document-level JavaScript, it depends on which version of Acrobat you're using. In Acrobat 9, you'd select: Advanced > Document Processing > Document JavaScripts

                                       

                                      It turns out Acrobat doesn't allow you to create field names with leading spaces, but somehow several fields in your form do have them. Here's a list:

                                       

                                      ' Building SitesLotsMaster Plan Zoning'

                                      ' HOA Fee'

                                      ' Other Fees'

                                      ' Pet Deposit'

                                      ' Processing Fee'

                                      ' Rental Fee Frequency'

                                      ' Rental Fee Move In Fee'

                                      ' Term 1'

                                      ' Term 2'

                                      ' of Buildings'

                                      ' of Docks'

                                      ' of Elevators'

                                      ' of Fireplaces'

                                      ' of Floors'

                                      ' of FloorsUnit'

                                      ' of Levels'

                                       

                                      You can order the field names in alphabetical order in the Fields pane when in Form Editing mode, and they will be at the top of the list. You can then click on each to detemine which page number they're on. You should rename them to remove the leading spaces.

                                      • 16. Re: Submit button error message
                                        dkfsbo1 Community Member

                                        Okay - stupid question - but what is a leading space?

                                        • 17. Re: Submit button error message
                                          George_Johnson ACP/MVPs

                                          The first (aka leading) character of the field name is a space character for the fields I listed. It's easy to miss, but the spaces are there.

                                           

                                          I'd be interested to know how you created those fields where the first character is a space, because Acrobat does not let me do it manually.

                                          • 18. Re: Submit button error message
                                            dkfsbo1 Community Member

                                            I will check it out - heading out of town for Easter - will let you know next week.  I really want to thank you George for all your help.

                                            Be in touch next week.

                                             

                                            deb