MARI

Tuesday, March 3, 2009

cfselect tag: how to use cfselect in xml format form





cfselectXmlForm.cfm







<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ColdFusion cfselect tag example: how to use cfselect in xml format form</title>
</head>

<body>
<h2 style="color:DodgerBlue">cfselect example: Xml Format Form</h2>
<cfif IsDefined("Form.Submit")>
You selected Employee: <cfoutput><b>#Form.Employee#</b></cfoutput>
<br /><br />
</cfif>

<cfquery name="qEmployee" datasource="cfdocexamples">
SELECT LastName FROM Employee
</cfquery>

<cfform name="SelectTestForm" format="xml" skin="beige" method="post">
<cfselect
name="Employee"
query="qEmployee"
display="LastName"
label="Employee"
>
</cfselect>
<cfinput type="submit" name="Submit" value="Submit">
</cfform>
</body>
</html>




















No comments:

Post a Comment