MACROMEDIA COLDFUSION MX 61-CFML Reference page 712

Cfml reference
Hide thumbs Also See for COLDFUSION MX 61-CFML:
Table of Contents

Advertisement

<p>After you enter employee information into structure, example uses
<b>StructKeyList</b> function to list keys in structure.</p>
<p>This code does not show how to insert information into a database.
See cfquery for more information about database insertion.
<hr size = "2" color = "#0000A0">
<form action = "structkeylist.cfm">
<table cellspacing = "2" cellpadding = "2" border = "0">
<tr>
<td>First Name:</td>
<td><input name = "firstname" type = "text"
value = "" hspace = "30" maxlength = "30"></td>
</tr>
<tr>
<td>Last Name:</td>
<td><input name = "lastname" type = "text"
value = "" hspace = "30" maxlength = "30"></td>
</tr>
<tr>
<td>EMail</td>
<td><input name = "email" type = "text"
value = "" hspace = "30" maxlength = "30"></td>
</tr>
<tr>
<td>Phone:</td>
<td><input name = "phone" type = "text"
value = "" hspace = "20" maxlength = "20"></td>
</tr>
<tr>
<td>Company:</td>
<td><input name = "company" type = "text"
value = "" hspace = "30" maxlength = "30"></td>
</tr>
<tr>
<td><input type = "submit" name = "submit" value = "OK"></td>
<td><b>After you submit form, scroll down to see the list.</b></td>
</tr>
</table>
</form>
<cfif NOT StructISEmpty(employee)>
<hr size = "2" color = "#0000A0">
<cfset keysToStruct = StructKeyList(employee,"<li>")>
<p>Here are the keys to the structure:</p>
<ul>
<li><cfoutput>#keysToStruct#</cfoutput>
</ul>
<p>If fields are correct, we can process new employee information.
If they are not correct, consider rewriting application.</p>
</cfif>
712
Chapter 3: ColdFusion Functions

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion mx

Table of Contents