Pre-populating forms with radio button values
I have been pulling my hair out trying to figure out why my action page is not being pre-populate with the value that is passed from the radio button selection. Can get my hands around what I am actually doing wrong. I have changed my code several times and can not keep up with any more. So below, I have included the main page and the action page that needs to be pre-populated with the data from the database. Thank you in advance for you help and time.
MAIN.cfm
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--- Declare and initialize the variables
--->
<cfset today = DateFormat(Now(),"mmmm d, yyyy")>
<cfset current_time = TimeFormat(Now(),"h:mm tt")>
<cfset application_name = "Corporate Intranet Directory">
<cfset current_url ='http://'& #CGI.SERVER_NAME# & ':'& #CGI.SERVER_PORT# & #CGI.SCRIPT_NAME#>
<cfset current_browser = #CGI.HTTP_USER_AGENT#>
<html>
<head>
<title>Employee Directory</title>
</head>
<!--- Included heading for the page--->
<h1>Employee Directory</h1>
<body>
<!--- Display the today date and the current time--->
<cfoutput>Today's date is #today#</cfoutput><br>
<cfoutput>The current time is #current_time#</cfoutput><p>
<!---Display the URL and Browser used for the template --->
<p><cfoutput>URL of this template: #current_url#</cfoutput>
<cfoutput>Browser used: #current_browser#</cfoutput></p>
<!---Insert a field to have the user search by email address --->
<tr bgcolor = "yellow">
<td>Search</td>
</tr><br>
Email: <input type="text" name="EmailAddress"
size="20" maxlength="100"><br>
<input type="Submit" value="Search"><p>
<!--- Query the Employees table to find the employee who's ManOfTheYear is set to "YES"--->
<cfquery name="employeeOfTheMonth" datasource="Directory">
select
e.FirstName,
e.LastName
from
Employees e
where
e.ManOfTheMonth = 'Yes'
</cfquery>
<!--- Query the Employees and Departments tables to find employee's First Name, Last Name, Title, Phone Extension, Email Address, and Department Name--->
<cfquery name="employees" datasource="Directory">
select
e.EmployeeID,
e.FirstName,
e.LastName,
e.Title,
e.PhoneExtension,
e.EmailAddress,
d.DepartmentName,
d.DepartmentID
from
Employees e,
Departments d
where
e.DepartmentID = d.DepartmentID
</cfquery>
<table border="2" bordercolor="blue">
<!--- Display the Employee of the Month--->
<cfoutput query="employeeOfTheMonth">
<tr>
<th align="center" colspan="5">Employee of the Month: #employeeOfTheMonth.FirstName# #employeeOfTheMonth.LastName# </th>
</tr>
</cfoutput>
<tr>
<th>ID</th>
<th>Name</th>
<th>Title</th>
<th>Department</th>
<th>Phone Extension</th>
<th>Email</th>
</tr>
<!--- Display the First Name, Last Name, Title, Department Name, Phone Extension, and Email Address--->
<form action="admin3.cfm?EmployeeID=#EmployeeID#" method="post">
<cfoutput query="employees">
<cfswitch expression="#DepartmentID#">
<cfcase value="1">
<cfset backgroundcolor="00FFFF">
</cfcase>
<cfcase value="2">
<cfset backgroundcolor="ff6699">
</cfcase>
<cfcase value="3">
<cfset backgroundcolor="99ff99">
</cfcase>
<cfcase value="4">
<cfset backgroundcolor="ffcc99">
</cfcase>
<cfcase value="5">
<cfset backgroundcolor="cc99ff">
</cfcase>
<cfdefaultcase>
<cfset backgroundcolor="red">
</cfdefaultcase>
</cfswitch>
<tr bgcolor=#backgroundcolor#>
<td><input type ="radio" name="EmployeeID" value="#employees.EmployeeID#"</td>
<td><a href="http://localhost:8500/spiderbytes/assignments/employee_details.cfm?EmployeeID=#EmployeeID#"> #employees.FirstName# #employees.LastName#</td>
<td>#employees.Title#</td>
<td>#employees.DepartmentName#</td>
<td>#employees.PhoneExtension#</td>
<td>#employees.EmailAddress#</td>
</tr>
</cfoutput>
<tr>
<!--- Display the number of employee's in the directory--->
<td align="right" colspan="5"><cfoutput>#employees.recordCount# Employee(s) found.</cfoutput></td>
</tr>
</table>
<input type="Submit" name="Action" value="Add New Employee">
<input type="Submit" name="Action" value="Edit Employee">
<input type="Submit" name="Action" value="Delete Employee"><p>
</form>
<!--- Include a footer --->
<CFINCLUDE template="footer.cfm">
</body>
</html>
