| 1 | <cfsetting enablecfoutputonly=true> |
|---|
| 2 | <!--- |
|---|
| 3 | Name : handlers/truefalse/display.cfm |
|---|
| 4 | Author : Raymond Camden |
|---|
| 5 | Created : September 21, 2004 |
|---|
| 6 | Last Updated : April 10, 2006 |
|---|
| 7 | History : New row for answers (rkc 10/7/05) |
|---|
| 8 | : Minor HTML mod (rkc 4/10/06) |
|---|
| 9 | Purpose : Supports True/False, Yes/No |
|---|
| 10 | ---> |
|---|
| 11 | |
|---|
| 12 | <cfparam name="attributes.yesno" default="false"> |
|---|
| 13 | <cfparam name="attributes.question"> |
|---|
| 14 | <cfparam name="attributes.r_result" default="result"> |
|---|
| 15 | <cfparam name="attributes.answer"> |
|---|
| 16 | <cfparam name="attributes.step"> |
|---|
| 17 | |
|---|
| 18 | <cfset showForm = true> |
|---|
| 19 | |
|---|
| 20 | <cfif isDefined("form.submit")> |
|---|
| 21 | <cfif not isDefined("form.question#attributes.step#") and attributes.question.required> |
|---|
| 22 | <cfset errors = "You must answer the question."> |
|---|
| 23 | <cfelse> |
|---|
| 24 | <!--- param for non required results ---> |
|---|
| 25 | <cfparam name="form.question#attributes.step#" default=""> |
|---|
| 26 | <cfset caller[attributes.r_result] = form["question#attributes.step#"]> |
|---|
| 27 | <cfset attributes.answer = form["question#attributes.step#"]> |
|---|
| 28 | </cfif> |
|---|
| 29 | </cfif> |
|---|
| 30 | |
|---|
| 31 | |
|---|
| 32 | <cfif isDefined("errors")> |
|---|
| 33 | <cfoutput> |
|---|
| 34 | <p class="error">#errors#</p> |
|---|
| 35 | </cfoutput> |
|---|
| 36 | </cfif> |
|---|
| 37 | |
|---|
| 38 | <cfoutput> |
|---|
| 39 | <div class="question">#attributes.step#) #attributes.question.question#</div> |
|---|
| 40 | <div class="answers"> |
|---|
| 41 | <cfif attributes.yesno> |
|---|
| 42 | <input type="radio" name="question#attributes.step#" value="yes" <cfif attributes.answer is "yes">checked</cfif>>Yes<br> |
|---|
| 43 | <input type="radio" name="question#attributes.step#" value="no" <cfif attributes.answer is "no">checked</cfif>>No<br> |
|---|
| 44 | <cfelse> |
|---|
| 45 | <input type="radio" name="question#attributes.step#" value="true" <cfif attributes.answer is "true">checked</cfif>>True<br> |
|---|
| 46 | <input type="radio" name="question#attributes.step#" value="false" <cfif attributes.answer is "false">checked</cfif>>False<br> |
|---|
| 47 | </cfif> |
|---|
| 48 | </div> |
|---|
| 49 | </cfoutput> |
|---|
| 50 | |
|---|
| 51 | <cfsetting enablecfoutputonly=false> |
|---|
| 52 | |
|---|
| 53 | <cfexit method="exittag"> |
|---|