15 Replies Latest reply on May 14, 2009 9:54 AM by -==cfSearching==-

    PDF Forms and Checkbox

    Rick
      Is there some trick to populating a checkbox on a PDF Form using cfpdfform? I need to check a couple of checkboxes on this PDF form. It will not accept anything I send to the field. I am not having any problems with any of the other text fields on the form, just the check boxes have this problem.

        • 1. Re: PDF Forms and Checkbox
          fmdano74

          Did you find a solution for this problem? This is something i am not able to figure out right now either. What to do what to do?

           

          thanks for any info.

           

          dan

          • 2. Re: PDF Forms and Checkbox
            -==cfSearching==- Level 4

            Check your "value".  Often it is due to using a wrong value, or the wrong cAsE.

            • 3. Re: PDF Forms and Checkbox
              fmdano74 Level 1

              Below is my form for the checkbox:

               

               

               

               

              <td

               

               

              colspan="2">30.Paying wiht Credit Card (Select One)

              </td>

               

               

              <td>Yes<cfinput type="checkbox" name="creditCardY" id="creditCardY" value="Yes" onclick="SingleSelect('chk',this);"

              >

              No

               

              <cfinput type="checkbox" name="creditCardN" id="creditCardN" value="No" onclick="SingleSelect('chk',this);"

              >

               

               

              </td>

               

               

              Now on the PDF file I see the name of the checkboxes: Radio Button1.0 each on would has a value: yes and no

               

               

              For my form I have tried Yes/No, 1/0, True/False

               

              Does this help? Any new ideas?

               

              Thanks

               

              dan

              • 4. Re: PDF Forms and Checkbox
                -==cfSearching==- Level 4

                fmdano wrote:

                 

                Now on the PDF file I see the name of the checkboxes: Radio Button1.0 each on would has a value: yes and no

                 

                 

                 

                What tool are you using to view the field information (pdfform action="info", acrobat .. ?).

                 

                Now on the PDF file I see the name of the checkboxes: Radio Button1.0 each on would has a value: yes and no

                 

                 

                For my form I have tried Yes/No, 1/0, True/False

                 

                 

                Are the checkbox values really lowercase yes and no, or is that just a typo?  Because cAsE matters (ie using "Yes" is not the same as "yes")

                • 5. Re: PDF Forms and Checkbox
                  fmdano74 Level 1

                  Hey,

                  I am using Acrobat 9 to view the fields...I am editing the fields and viewing what the field information is.

                   

                  radio1.jpg

                   

                  from the image above you can see the from name is Radio Button1.0 and each button is named Yes and No. However when you see them on the actual PDF file, they are checkboxes. Does this help any?

                   

                  thanks for all your help in trying to solve this mystery.

                   

                  Dan

                  • 6. Re: PDF Forms and Checkbox
                    -==cfSearching==- Level 4

                    from the image above you can see the from name is Radio Button1.0 and each button is named Yes and No. However when you see them on the actual PDF file, they are checkboxes.


                    That is odd.  What results do you get if you dump the form info using <cfpdf>? Also, did you try creating a simplified version, to make sure it is not a problem with this form?

                    • 7. Re: PDF Forms and Checkbox
                      fmdano74 Level 1

                      being very new to the cfpdf stuff, I am not even sure how to use cfpdf properly to dump out the form variables. This template pdf file was created by someone else, so it may be beneficial if I change the form values so it is easier to manipulate them.

                       

                      thanks for the continued help.

                      • 8. Re: PDF Forms and Checkbox
                        -==cfSearching==- Level 4

                        Sorry, I meant to write <cfpdfform>.  What are the results of the cfdump?

                         

                         

                        <cfpdfform action="read"
                              source="c:\pathTo\yourForm.pdf"
                              result="info">

                         

                        <cfdump var="#info#">

                         

                        http://livedocs.adobe.com/coldfusion/8/htmldocs/Tags_p-q_03.html

                        • 9. Re: PDF Forms and Checkbox
                          fmdano74 Level 1

                          Here is the dump info for the radio button. now what does this mean?

                           

                          radio2.jpg

                          • 10. Re: PDF Forms and Checkbox
                            fmdano74 Level 1

                            would it be easier for me to edit the pdf template and make each radio button a separate name since I am filling them in from a coldfusion page?

                            • 11. Re: PDF Forms and Checkbox
                              -==cfSearching==- Level 4

                              fmdano wrote:

                               

                              would it be easier for me to edit the pdf template and make each radio button a separate name since I am filling them in from a coldfusion page?

                              Radio buttons tend have the same name so they are grouped (ie only one can be selected at a time).  But since you are using them as a checkbox, yes use separate names.  BTW, is there not a checkbox type?

                              • 12. Re: PDF Forms and Checkbox
                                fmdano74 Level 1

                                Now,

                                my PDF file has two radio buttons one named radiobutton_yes and other radiobutton_no

                                below are my pdfformparams. Now, what am I doing wrong since i pass in this info, but still nothing is being checked. The form values are Yes for rb_yes, and No for rb_no. Does this cfpdfformparm look right?

                                 

                                <cfpdfformparam

                                 

                                name="RadioButton_yes" value="#arguments.form.creditCardY#">

                                <cfpdfformparam

                                 

                                name="RadioButton_no" value="#arguments.form.creditCardN#">

                                 

                                 

                                radio3.jpg

                                I feel like something is just off and I'm not sure what.

                                • 13. Re: PDF Forms and Checkbox
                                  -==cfSearching==- Level 4

                                  Dump the form again.  What are the values?

                                   

                                  1. What about the checkbox type? (I do not use acrobat 9.)

                                  2. Any chance you could create a smaller version of the pdf (just the buttons) and upload it here?

                                  • 14. Re: PDF Forms and Checkbox
                                    fmdano74 Level 1

                                    I may have finally figured out my problem. Since the values are in a structure, adobe 9 does not use dot notation to reference anything in the structure. So, I had to use a cfpdfsubform to name the main form: Radio Button1. Then inside that tag, I used my cfpdfformparm and named it 0 since that was the structure name:

                                     

                                     

                                     

                                     

                                     

                                     

                                    <cfpdfsubform

                                     

                                     

                                    name="Radio Button1"

                                    >

                                     

                                     

                                    <cfif isDefined("arguments.form.creditcardY")

                                    >

                                     

                                     

                                    <cfpdfformparam name="0" value="Yes"

                                    >

                                     

                                     

                                    <cfelseif isDefined("arguments.form.creditcardN")

                                    >

                                     

                                     

                                    <cfpdfformparam name="0" value="No"

                                    >

                                     

                                     

                                    </cfif>

                                     

                                     

                                    </cfpdfsubform>

                                     

                                    Looks like this solved my problem. I thank you for all your help. I may have found the answer in the CF LiveDocs, but without your help, such as how to dump variables, I think i'd still be a couple of days back.

                                     

                                    Thanks again...if I have any other issues, I'm sure I'll post them here.

                                     

                                    Dan

                                    • 15. Re: PDF Forms and Checkbox
                                      -==cfSearching==- Level 4

                                      I am glad you solved it. Interesting about pdfsubform. I was thinking more along the lines of using dot notation: "Radio Button 1.0" to reference the field. So thanks for posting the solution.

                                       

                                      Cheers