brettstil
asked on
CFGRID selectmode
My form page has the following code. On my action page I want to refer to the value of PersonID of the selected row. I haven't been able to get this to work, even though it's probably pretty simple. What is the exact variable name that I should use on the action page? (eg, form.MailingGrid.PersonID or what?) Thx.
<cfform action="mailing_action.cfm " method="POST" name="loginform">
<cfgrid name="MailingGrid" height="290" width="760" query="GetListValues" selectmode="ROW" sort="yes" rowheaders="no" bgcolor="##ffffff" selectcolor="##cccccc">
<cfgridcolumn name="PersonID" select="no" display="no">
<cfgridcolumn name="NameFirst" header="First Name" select="no" width="90">
<cfgridcolumn name="NameLast" header="Last Name" select="no" width="90">
</cfgrid>
</cfform>
<cfform action="mailing_action.cfm
<cfgrid name="MailingGrid" height="290" width="760" query="GetListValues" selectmode="ROW" sort="yes" rowheaders="no" bgcolor="##ffffff" selectcolor="##cccccc">
<cfgridcolumn name="PersonID" select="no" display="no">
<cfgridcolumn name="NameFirst" header="First Name" select="no" width="90">
<cfgridcolumn name="NameLast" header="Last Name" select="no" width="90">
</cfgrid>
</cfform>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
<html>
<head>
<title>CFGRID</title>
</head>
<body>
<cfif IsDefined("submitButton")>
<cfoutput>
#employeeGrid.full_name#
<br>
#employeeGrid.employee_num
</cfoutput>
<cfelse>
<cfquery name="employees" datasource="#datasource#">
select full_name, employee_number from xyz.whiteGreen
where current_employee = 'Y'
order by full_name;
</cfquery>
<cfform name="employeeForm" action="empInfo.cfm" method="post">
<CFGRID NAME="employeeGrid" query="employees" selectmode="ROW">
<cfgridcolumn name="full_name" header="Full Name">
<cfgridcolumn name="Employee_Number" header="Employee Number">
</cfgrid>
<input type="submit" name="submitButton" value="submit">
</cfform>
</cfif>
</body>
</html>