[thelist] CF form problems...
Daniel Fascia
danfascia at totalise.co.uk
Sun Jun 2 13:06:00 CDT 2002
Im trying to read the input from a set of radio buttons in CF for a multiple choice question engine Im making...
for some reason I can <CFOUTPUT> the values (for debugging) and they are working fine but I cannot evaluate them in <CFIF> or <CFSWITCH> expressions
anybody got any ideas.... code below.
BTW I know SWITCH is more elegant but hey, neither are working at the moment!?!?!
------------------------------8<-----------------8<-------------------
<form name="MCQ" method="POST" action="<cfoutput>index.cfm?case=#case#§ion=mcq&page=1&action=check</cfoutput>">
<p>What is the most likely causative organism for pneumonia in the UK?</p>
<input type="radio" name="Question_<cfoutput>#page#</cfoutput>" value="1"> Streptococcus pneumoniae<br/>
<input type="radio" name="Question_<cfoutput>#page#</cfoutput>" value="2"> Haemophilus influenzae<br/>
<input type="radio" name="Question_<cfoutput>#page#</cfoutput>" value="3"> Legionella pneumophila<br/>
<input type="radio" name="Question_<cfoutput>#page#</cfoutput>" value="4"> Viral pneumonia<br/><br/>
<button type="submit">check answer</button>
</form>
<cfif isDefined("action")>
<cfif action IS "check">
<cfset answer = "Question_#page#">
<cfif answer EQ "1">
<b>correct</b>
</cfif>
<cfelseif answer IS "2">
incorrect
</cfif>
</cfif>
More information about the thelist
mailing list