| [5] | 1 | <cfsetting enablecfoutputonly=true> |
|---|
| 2 | <!--- |
|---|
| 3 | Name : handlers/textbox/display.cfm |
|---|
| 4 | Author : Raymond Camden |
|---|
| 5 | Created : September 21, 2004 |
|---|
| 6 | Last Updated : April 10, 2006 |
|---|
| 7 | History : minor format change (rkc 10/7/05) |
|---|
| 8 | restrict to 255 (rkc 10/12/05) |
|---|
| 9 | minor html change (rkc 4/10/06) |
|---|
| 10 | Purpose : Supports Textbox, single and multi |
|---|
| 11 | ---> |
|---|
| 12 | |
|---|
| 13 | <cfparam name="attributes.single" default="true"> |
|---|
| 14 | <cfparam name="attributes.step"> |
|---|
| 15 | |
|---|
| 16 | <cfif isDefined("form.submit")> |
|---|
| 17 | <cfif (not isDefined("form.question#attributes.step#") or not len(form["question#attributes.step#"])) and attributes.question.required> |
|---|
| 18 | <cfset errors = "You must answer the question."> |
|---|
| 19 | <cfelse> |
|---|
| 20 | <cfif attributes.single> |
|---|
| 21 | <cfset form.question = left(form["question#attributes.step#"], 255)> |
|---|
| 22 | </cfif> |
|---|
| 23 | <cfset caller[attributes.r_result] = form["question#attributes.step#"]> |
|---|
| 24 | <cfset attributes.answer = form["question#attributes.step#"]> |
|---|
| 25 | </cfif> |
|---|
| 26 | </cfif> |
|---|
| 27 | |
|---|
| 28 | <cfif isDefined("errors")> |
|---|
| 29 | <cfoutput> |
|---|
| 30 | <p class="error">#errors#</p> |
|---|
| 31 | </cfoutput> |
|---|
| 32 | </cfif> |
|---|
| 33 | |
|---|
| 34 | <cfoutput> |
|---|
| 35 | <div class="question">#attributes.step#) #attributes.question.question#</div> |
|---|
| 36 | <div class="answers"> |
|---|
| 37 | <cfif attributes.single> |
|---|
| 38 | <input type="text" name="question#attributes.step#" value="#attributes.answer#" maxlength="255"> |
|---|
| 39 | <cfelse> |
|---|
| 40 | <textarea name="question#attributes.step#" cols=40 rows=10>#attributes.answer#</textarea> |
|---|
| 41 | </cfif> |
|---|
| 42 | </div> |
|---|
| 43 | </cfoutput> |
|---|
| 44 | |
|---|
| 45 | <cfsetting enablecfoutputonly=false> |
|---|
| 46 | |
|---|
| 47 | <cfexit method="exittag"> |
|---|