MARI

Tuesday, March 3, 2009

cfselect tag: how to use cfselect with cfquery and static option





cfselectStatic.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 with cfquery and static option</title>
</head>

<body>
<h2 style="color:DodgerBlue">cfselect example: With cfquery and Static option</h2>
<cfif IsDefined("Form.Submit")>
You selected Art: <cfoutput><b>#Form.Art#</b></cfoutput>
<br />
</cfif>

<cfquery name="qArt" datasource="cfartgallery">
SELECT ArtName FROM Art
</cfquery>

<cfform name="SelectTestForm" method="post" action="">
<cfselect name="Art" query="qArt" display="ArtName" queryPosition="below">
<option>Select</option>
</cfselect>
<cfinput type="submit" name="Submit" value="Submit Art">
</cfform>
</body>
</html>




















No comments:

Post a Comment