
765
DEVELOPING
COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
Las
t
upda
te
d 8/5/2010
<cfcatch type="expression">
<cfset goodData="No">
<cfoutput>
Invalid e-mail address.<br>
#cfcatch.detail#<br><br>
</cfoutput>
</cfcatch>
</cftry>
<!--- The cftry block for testing the telephone number value. --->
<cftry>
<cfparam name="form.phoneNo" type="telephone">
<cfcatch type="expression">
<cfset goodData="No">
<cfoutput>
Invalid telephone number.<br>
#cfcatch.detail#<br><br>
</cfoutput>
</cfcatch>
</cftry>
<!--- Do this only if the validity indicator was not set to False in a
validation catch block. --->
<cfif goodData>
<!--- Application code to update the database goes here. --->
<cfoutput>
<h3>The e-mail address and phone number for user #Form.UserID#
have been added</h3>
</cfoutput>
</cfif> <!--- goodData is True--->
</cfif> <!--- Form was submitted. --->
<cfform action="#CGI.SCRIPT_NAME#" preservedata="Yes">
User ID:<cfinput type="Text" name="UserID"><br>
Phone: <cfinput type="Text" name="phoneNo"><br>
E-mail: <cfinput type="Text" name="emailAddr"><br>
<cfinput type="submit" name="saveSubmit" value="Save Data"><br>
</cfform>
Creating Forms in Flash
You can create effective forms in Adobe Flash format, in which Adobe ColdFusion displays forms using Flash, not
HTML.
About Flash forms
ColdFusion can deliver forms to the client in Flash (SWF file) format. ColdFusion automatically generates the Flash
binary from your CFML code and displays it on the client. Flash forms have the following advantages over HTML
forms:
•
They are browser-independent. Flash Player works in all commonly used browsers on Windows and Macintosh
systems, and in Netscape and Mozilla on Linux.
•
By default, they present a modern, visually pleasing appearance, and you can apply predefined color skins or
customize the appearance with specifications like those specifications in a Cascading Style Sheet (CSS).
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...