Search code examples
pdfxfdf

How to trigger checkboxes with XFDF


Here is what I have:

<?xml version="1.0" encoding="UTF-8"?>
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
<fields>
<field name="text1">
<value>First Last</value>
<field name="checkbox1">
<value>yes</value>
</field>
<field name="checkbox2">
<value></value>
</field>
<ids original="xxxxx" modified="1331062234" />
<f href="http://example.com/test.pdf" />
</xfdf>

The text value gets entered in the PDF, but I can't figure out how to get the checkboxes to recognize that they are checked.


Solution

  • <input type="checkbox" name="checkbox_name" value="yes" />
    

    The xfdf value entry needs to match the checkbox value:

    <field name="checkbox_name">
       <value>yes</value>
    </field>