Advertisement

02.02.2001 at 02:19AM PST, ID: 20068756
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.0

making and retrieving form fields as arrays

Asked by kandura in ColdFusion Application Server

Tags: , , , ,

hi,

i need to display a number of marketing questions from the database. The number can change, but let's say it's 3 at the moment. The questions can be yes/no or "wh", so depending on the sort i need either a text field or a radio button. So far so good.
The problem comes when i try to retrieve the info in these fields. I want to put them in an array, and then loop through it, but i haven't been succeeding.

Here's the code of the form with the fields: (qMQ is the query)

<table width="90%">
     <cfoutput query="qMQ" maxrows="3">
     <tr>
          <Td><input type="Hidden" name="QuestionID#qMQ.CurrentRow#" value="#qMQ.int_MarketingQuestionid#">
               #qMQ.vch_MarketingQuestion#
          </td>
          <td>
               <cfswitch expression="#tnt_MarketingQuestionType#">
                    <cfcase value="1">
                         <input type="Text" size="30" maxlength="200" name="Answers#qMQ.CurrentRow#">
                    </cfcase>              
                    <cfcase value="2">
                         Yes <input type="Radio" name="Answers#qMQ.CurrentRow#" value="Yes" checked>
                         No <input type="Radio" name="Answers#qMQ.CurrentRow#" value="No">
                    </cfcase>
               </cfswitch>
          </td>
     </tr>    
     </cfoutput>
<tr>
     <td>
     <br>
          <input type="Submit" value="Save my answers">
     </td>
</tr>    
</table>

I've tried to define Answers as an array, and then define another array in the file it gets submitted to, but that didn't work either. What i'd like to have is something like:

<cfloop from="firstformfield" to="maxrows">

<cfstoredproc datasource="#Application.DSName#" procedure="sp_AddMarketingAnswer" returncode="No">
     <cfprocparam type="In" dbvarname="@QuestionId" value="#QuestionID[i]#" cfsqltype="CF_SQL_INTEGER">
     <cfprocparam type="In" dbvarname="@Answer" value="#Form.Answers[i]#" cfsqltype="CF_SQL_VARCHAR">
     <cfprocresult name="qMQ" resultset="1">
     </cfstoredproc>


where [i] is the number of the element.

Is this possible, and if yes how? If not, what's the normal method?

thanks,
kandura

Start Free Trial
 
 
[+][-]02.02.2001 at 05:49AM PST, ID: 5805981

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.02.2001 at 05:55AM PST, ID: 5805997

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.02.2001 at 05:57AM PST, ID: 5806004

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.02.2001 at 06:12AM PST, ID: 5806029

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.02.2001 at 06:54AM PST, ID: 5806157

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 30-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.02.2001 at 07:08AM PST, ID: 5806218

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]02.02.2001 at 07:23AM PST, ID: 5806266

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: ColdFusion Application Server
Tags: array, cfprocparam, cfoutput, fields, form
Sign Up Now!
Solution Provided By: PatrikMueller
Participating Experts: 2
Solution Grade: A
 
 
[+][-]03.07.2001 at 07:16AM PST, ID: 5907493

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-44