OK.  I understand that.  So I tried the following on the form page and it
gave me blanks also.  
<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>

<form name="TargetGroups" action="ProcessPage7.cfm" method="post">
<table border="1"><tr><th>District Policy</th><th>School
Option</th></tr><tr>


<!--- <input type="Hidden" name="DistrictId" value="#session.DistrictID#">
--->
<cfoutput query="qryPolicy">

<td><input type="hidden" value="#Policynumber#" name="Policynumber">
<input type="Checkbox" value="#District#" name="District"> </td>
<td><input type="Checkbox" value="#School#" name="School"> </td>
<td><font size="-1" style="TimesNewRoman"> #Policyname#</font></td></tr>

</cfoutput></table>
<input type="Submit" value="SUBMIT">



</form>

This is an input form only.  I do not need to reflect what is already in the
database.  How do I set checked boxes to true, leave the unchecked boxes
alone and 

-----Original Message-----
From: Clint Tredway [mailto:[EMAIL PROTECTED]]
Sent: Thursday, August 02, 2001 11:18 AM
To: [EMAIL PROTECTED]
Subject: Re: Getting the data from checkboxes into the database


You have to have a value in your check box form element. If there is no
value, then there is nothing to insert.

HTH

---------- Original Message ----------------------------------
From: "Susan N. Klos" <[EMAIL PROTECTED]>
Date: Thu, 2 Aug 2001 11:14:24 -0400 

Table to insert into:
tlnkPolicy
     PolicyID - PK
     DistrictID - FK
     PolicyNumber - FK
     District - Yes/No
     School - Yes/No
     PolicyDesc
 
Form page:
 
<cfquery name="qryPolicy" datasource="sdfs">
Select PolicyNumber, PolicyName
>From tblPolicy
</cfquery>
 
<form name="TargetGroups" action="ProcessPage7.cfm" method="post">
<table border="1"><tr><th>District Policy</th><th>School
Option</th></tr><tr>
 

 
<td><input type="hidden" value="#Policynumber#" name="Policynumber">
<input type="Checkbox" value="" name="District"> </td>
<td><input type="Checkbox" value="" name="School"> </td>
<td><font size="-1" style="TimesNewRoman"> #Policyname#</font></td></tr>
 
</cfoutput></table>
<input type="Submit" value="SUBMIT">
</form>
 
 
 
Action Page:
<cfloop list="#PolicyNumber#" index="i">
<cfquery datasource="#application.db#">
 Insert into tlnkPolicy (DistrictID, District, School, PolicyNumber)
 Values ('#session.DistrictID#', '#form.District#', '#form.School#', #i#)
</cfquery>
</cfloop>
 
The problem is that no matter what I do or do not check in the checkboxes on
the form, all of the policynumber(s) show up in the database and nothing in
the District or School columns.  There should be blanks or yes in the
District or School columns. And I do not want to see a record for a
policynumber if there is no check in District, School or both
 
 
 
 
 
 



-------------------------------------------------------------------------
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



-------------------------------------------------------------------------
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

-------------------------------------------------------------------------
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

Reply via email to