Any idea why the code below is not working the way it should, as you can see
from my cfif statements the checkbox fields should only be checked if there
is a value in the database for that entry and the same for the permissions
select.
But at present every checkbox is checked and every select box is populated
with a value when it should'nt be ?
Can anybody see why this is occuring is it my queries, the placing of my
cfoutputs? or the actual cfif statements ??
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Untitled</title>
</head>
<body>
<CFQUERY DATASOURCE="perm" NAME="updateusers">
SELECT *
FROM users
WHERE id = #session.id#
</CFQUERY>
<CFQUERY DATASOURCE="perm" NAME="getgroups">
SELECT groupid, groupname, permname, permid
FROM groups, permissions
</CFQUERY>
<cfquery datasource="perm" name="qryGetUserGroupsPerms">
SELECT users.id AS "userid",
users.fname,
users.lname,
users.username,
users.password,
users.email,
users.position,
users.division,
groups.groupname,
permissions.permname,
userpermissions.groupid,
userpermissions.permid
FROM ((
users INNER JOIN usergrouppermissions AS userpermissions ON users.id =
userpermissions.userid)
INNER JOIN permissions AS permissions ON userpermissions.permid =
permissions.permid)
INNER JOIN groups AS Groups ON userpermissions.groupid = groups.groupid
WHERE (((users.id)=#session.id#));
</cfquery>
<table>
<cfoutput query="getgroups" group="groupID">
<tr>
<td width="39%" height="20">#getgroups.groupname#</td>
<td width="3%" align="center" height="20">
<input type="checkbox" name="groupid" value="#getgroups.groupid#" <cfif
getgroups.GroupID IS getgroups.groupid> checked</cfif>>
</td>
<td width="45%" height="21">
<select size="1" name="perm#qryGetUserGroupsPerms.groupid#">
<cfoutput>
<option value="#getgroups.PermID#" <cfif qryGetUserGroupsPerms.PermID
IS getgroups.PermID>selected</cfif> >#getgroups.PermName#</option>
</cfoutput>
</select>
</td>
</tr> </cfoutput>
</table>
</body>
</html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for
dependable ColdFusion Hosting.
http://www.cfhosting.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4