No, Jeremy, I want this form to be for input only.
Let me back up a bit. I have two tables:
tblPolicy
PolicyNumber PK
PolicyName
tlnkPolicy
PolicyID - PK
DistrictID - FK from another table
PolicyNumber - FK from tblPolicy
District - Yes/No
School - Yes/No
PolicyDesc - will be input if they check other
The form lists all the Policy Names from tblPolicy. The checkboxes should
be blank so that if a particular policy is a District Policy or a School
policy the user can check the appropriate boxes. They might check one, both
or none.
On the action page I want the checked boxes for whatever policynumbers to go
into the database as yes. If a checkbox is not checked it can go in as no
or stay blank. And if no checkboxes are checked for any Policy Names I do
not want a record to be inserted into the database. Keep in mind the table
on the form is being generated dynamically from the database.
I may have the form set up incorrectly to do what I want to do also. Here is
the full page for the form:
<CFQUERY NAME="qryPolicy" DATASOURCE="SDFS">
SELECT tblPolicy.PolicyNumber, tblPolicy.PolicyName, tlnkPolicy.District,
tlnkPolicy.School
FROM tblPolicy LEFT JOIN tlnkPolicy ON tblPolicy.PolicyNumber =
tlnkPolicy.policyNumber
</CFQUERY>
<html>
<head>
<title>Page 7</title>
</head>
<body>
<form name="TargetGroups" action="ProcessPage7.cfm" method="post">
<table border="1"><tr><th>District Policy</th><th>School
Option</th></tr><tr>
<cfoutput query="qryPolicy">
<td><input type="hidden" value="#Policynumber#" name="Policynumber">
<input type="Checkbox" value="yes" name="District"> </td> (I put yes in
here at someone else's suggestion)
<td><input type="Checkbox" value="yes" name="School"> </td> (same here)
<td><font size="-1" style="TimesNewRoman"> #Policyname#</font></td></tr>
</cfoutput></table>
<input type="Submit" value="SUBMIT">
</form>
</body>
</html>
Here is what I have on the action page so far:
<cfloop list="#PolicyNumber#" index="i">
<cfif isdefined("form.district") or isdefined("form.school")>
<cfquery datasource="#application.db#">
Insert into tlnkPolicy (DistrictID, District, School, PolicyNumber)
Values ('#session.DistrictID#', '#form.District#', '#form.School#',
#i#)
</cfquery>
</cfif>
</cfloop>
-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com
-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org