1 | A dynamic form is an HTML form generated by a cfm file that uses elements created with database query results and CFML. |
2 | This example shows a select list of employees' names that is created with a query against the employees table. |
3 | <CFQUERY NAME="EmpName" DATASOURCE="CF 3.0 Examples"> |
4 | SELECT Employee_ID, LastName, FirstName |
5 | FROM Employees |
6 | </CFQUERY> |
7 | <FORM ACTION="example.cfm" METHOD="post"> |
8 | <SELECT NAME="Employee_ID"> |
9 | <CFOUTPUT QUERY="EmpName"> |
10 | <OPTION VALUE="#Employee_ID#">#LastName#, #FirstName# |
11 | </CFOUTPUT> |
12 | </SELECT> |
13 | <INPUT TYPE="submit" VALUE="Submit"> |
14 | </FORM> |