I'm doing several survey forms in succession. How do I pre-populate
checkboxes and radio buttons from a column string in a mssql database. I
tried <cfif> statements around each checkbox, but when I submitted to go to
the next form, it looks like the <cfif> would always overlay what was
changed by the user back to what was in the database.  So, I need to
prepopulate the checkboxes/radios to what the DB had and then allow the
person to change it. On the form  

e.g.:  "desigstring" column data = 01,02,03,06

And I want the checkboxes to reflect what was already listed in the column.


CHECKBOX EXAMPLE
<cfquery name="desiginfo" datasource="xyz">
select desigstring from info where '#mid#' = id
</cfquery>

<cfform action="orsq3.cfm" method="POST">
Professional Designations/Degrees/Licenses Held (Select as many as
apply)<br> 

<cfinput type="Checkbox" name="question2a" value="01">AEP<br>
<cfinput type="Checkbox" name="question2a" value="02">AHLC<br>
<cfinput type="Checkbox" name="question2a" value="03">CBA<br>
<cfinput type="Checkbox" name="question2a" value="04">CEBS<br>
<cfinput type="Checkbox" name="question2a" value="05">CFA<br>
<cfinput type="Checkbox" name="question2a" value="06">CFP<br>

<Input type="submit" value="Next Question Please">
</cfform>


RADIO EXAMPLE
e.g.:  "mrs_participate" column data = 1 or 0

<cfquery name="MRS" datasource="xyz">
select mrs_participate from info where '#mid#' = id
</cfquery>

<b>Would you like to participate in the media referral service?<br>

<cfform action="orsq9.cfm?mid=#url.mid#" method="POST">
<cfinput type="Radio" name="question8" value="1">YES<br>
<cfinput type="Radio" name="question8" value="0">NO<br>

<Input type="submit" value="Next Question Please">
</cfform>

Brian D. Horn
Society of Financial Service Professionals
Information Systems Group
610-526-2500
mailto:[EMAIL PROTECTED]
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to