Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Norman #1
Please help with multiple checkboxes?
Greetings:
A question on a test (form) has 2 correct answers, "ans_b" and "ans_c".
In the DB, the "ans_correct" field contains both values, comma
separated, (ans_b, ans_c).
The test question has three choices, and is set up:
<ol>
<li><input type="checkbox" name="q01_ch01" value="ans_a">#ans_a#</li>
<li><input type="checkbox" name="q01_ch02" value="ans_b">#ans_b#</li>
<li><input type="checkbox" name="q01_ch03" value="ans_c">#ans_c#</li>
</ol>
For answers in the test that have one correct answer, radio buttons were
used. Processing those are easy:
<CFSET num_correct =0>
<cfquery datasource="somedata" name="get_03">
SELECT quest_ID, ans_correct
FROM sometable
WHERE quest_ID = 3
</cfquery>
<cfoutput query="get_03">
<cfif #form.ans_03# eq #ans_correct#>
<CFSET num_correct = num_correct +1>
<cfelse><CFSET 'num_correct' = num_correct +0>
</cfif></cfoutput>
How would the action page be coded that would tally the number of
correct answers for multiple checkbox responses!?
There are other ways to do this, too?
Thanks- Norman
Norman Guest
-
multiple checkboxes issue
I have the following form that displays results to a user: --------------- <form action="edi_832_apply_changes.cfm" method="POST" name="sku_deta">... -
Select multiple checkboxes
Hi all, Let's say I have a screen of fifty checkboxes in a grid style. How can I set it up so that instead of clicking each individual checkbox, a... -
Delete Multiple items with checkboxes
Hello all, I'm sorry for posting this because you probably answered this question a million times, but i didn't got my script to run yet. I'm... -
multiple delete with checkboxes ?
Hi ! back again... got this problem with multiple delete with checkboxes. when i click the 'Delete user' link i get all users in the db listed... -
Multiple Checkboxes Help Needed
I'm using MySQL to display data on a web page - fitting about 10 records of data per screen - I'm including a checkbox with each record so that I...



Reply With Quote

