Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 962

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Working with Documents, Charts, and Reports
<!--- The following code retrieves all of the employee information for the
user name entered on the login page. --->
<cfquery name="getEmpInfo" datasource="cfdocexamples">
SELECT * FROM EMPLOYEES
WHERE EMAIL = <cfqueryparam value="#FORM.username#">
</cfquery>
<h3>Choose a tax form</h3>
<p>Hello <cfoutput>#getEmpInfo.firstname#</cfoutput>,</p>
<p>Please choose a tax form from the list:</p>
<!--- Create a pop-up menu with a list of tax forms. --->
<cfset thisPath=ExpandPath(".")>
<!--- Create a variable called filerID that is a combination of the username and the last
three digits of the Social Security number. --->
<cfset filerID="#form.username#_#form.SS3#">
<cfdirectory action="list" name="taxForms" directory="#thisPath#/taxforms">
<cfform name="taxList" method="post" action="TaxFile3.cfm">
<cfselect query="taxForms" value="name" size="10" required="yes" multiple="no"
name="myTaxForm"/>
<br/><br/>
<cfinput type="Submit" name="OK" label="OK">
<!--- Use hidden fields to pass the first name, last name, and the three parts of
the SSN# to the tax form. Also, create a hidden field for the filerID variable. --->
<cfinput type="hidden" name="FirstName" value="#getEmpInfo.FirstName#">
<cfinput type="hidden" name="LastName" value="#getEmpInfo.LastName#">
<cfinput type="hidden" name="Phone" value="#getEmpInfo.Phone#">
<cfinput type="hidden" name="SS1" value="#form.SS1#">
<cfinput type="hidden" name="SS2" value="#form.SS2#">
<cfinput type="hidden" name="SS3" value="#form.SS3#">
<cfinput type="hidden" name="taxFiler" value="#filerID#">
</cfform>
The third ColdFusion page uses the
information. ColdFusion displays the tax prefilled tax form in the browser window where the user can complete the
rest of the form fields. When the user clicks the submit button, Acrobat sends the completed PDF form to the
ColdFusion processing page.
Note: To prefill forms, map each PDF form field name to the corresponding data element in a
view the form fields, open the form in Acrobat Professional and select Forms > Edit Forms in Acrobat. For more
information about prefilling forms, see
and
cfpdfform
cfpdfformparam
"Manipulating PDF Forms in
Last updated 1/20/2012
tags to populate the tax form with the user
cfpdfformparam
ColdFusion" on page 914.
957
tag. To

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents