Hello,

I am trying to populate a pdf (application, complete with form fields, altho not all are named uniquely) from a form. I am having trouble populating certain fields which are undefined/unnamed in the original pdf, or which seem to have child arrays I can't get to...I know this has got to be simple. Usually when parsing RSS all I have to do is:

#element.parent.child[1]#

The form itself is nothing special just html. Here is the Coldfusion I am using to process it and write the pdf values:

<cfpdfform source="form.pdf" destination="moosh.pdf" action="populate" overwrite="yes" >

    <cfpdfsubform name="topmostSubform">

<cfpdfformparam name="Employer_Name___Address_incl_zip" value="#form.Employer_Name___Address_incl_zip#">

        <cfpdfformparam name="phone" value="#form.phone#">

        <cfpdfformparam name="Report_Purpose_Code[1]" value="#form.Report_Purpose_Code[1]#">  

                <cfpdfformparam name="Report_Purpose_Code" value="#form.Report_Purpose_Code#">  

        <cfpdfformparam name="Agent_Name___Code_Number" value="#form.Agent_Name___Code_Number#">    
           
</cfpdfsubform>
</cfpdfform>

Here is an image of the pdf dump showing what I think is the issue...

Bound to be something simple. I am thinking I should remake their pdf and properly name each form field...

*update: now that i am logged in to my native system i do see an error:
"
You have attempted to dereference a scalar variable of type class java.lang.String as a structure with members. "

form.Report_Purpose_Code[1]

FORM fields aren't arrays. They're simple names. So make the <form> field names unique, and use the simple names to populate the form.

... value="#form.Report_Purpose_Code1#">
... value="#form.Report_Purpose_Code2#">

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.