Advertisement

03.06.2001 at 05:47AM PST, ID: 20087571
[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!

8.0

retrieving form fields with dynamic names

Asked by kandura in ColdFusion Application Server

hi, this has been driving me really crazy. I'm not sure i haven;t asked this one before, but i'm sure i never got an answer.

i have a form with a number of textfields. The number depends on the recordcount of the query they're generated by. Then when the form is submitted, i want to read the fields in a loop. But i haven't been able to figure out yet how to do this.  

I can't imagine there's not a relatively simple solution for it, so i hope somebody knows it.

This is what i'm trying to do:

<cfif IsDefined("form.NamePortfolioSubmit")><!--- if submitted, save new names --->
     <cfloop from="1" to="#form.portfolioCount#" index="i">
     <cfset PortfolioName = ???? this is where the dynamic form name should come. Something like form.AccountNR#i#>
          <cfset AccountNR = same as above>

<!--- stored proc to update the names --->          
<CFSTOREDPROC datasource="#Application.DSName#" procedure="sp_NameUserPortfolio" returncode="Yes">
          <CFPROCPARAM type="In" dbvarname="@UserID" value="#UserID#" cfsqltype="CF_SQL_INTEGER">
          <CFPROCPARAM type="In" dbvarname="@CompetitionID" value="#CompetitionID#" cfsqltype="CF_SQL_INTEGER">
          <CFPROCPARAM type="In" dbvarname="@accountNR" value="#AccountNR#" cfsqltype="CF_SQL_VARCHAR">
          <CFPROCPARAM type="In" dbvarname="@PortfolioName" value="#PortfolioName#" cfsqltype="CF_SQL_VARCHAR">
          <CFPROCRESULT NAME="rsUserPortfolio" resultset="1">
          </CFSTOREDPROC>
     </cfloop>
</cfif>

<CFSTOREDPROC datasource="#Application.DSName#" procedure="sp_GetUserPortfolioByUserID" returncode="Yes">
<CFPROCPARAM type="In" dbvarname="@UserID" value="#UserID#" cfsqltype="CF_SQL_INTEGER">
<CFPROCPARAM type="In" dbvarname="@CompetitionID" value="#CompetitionID#" cfsqltype="CF_SQL_INTEGER">
<CFPROCRESULT NAME="rsUserPortfolio" resultset="1">
</CFSTOREDPROC>
<form action="nameportfolio.cfm" method="post">
<table width="50%">
     <tr>
          <td>
               AccountNr
          </td>
          <td>
               PortfolioName
          </td>
     </tr>
<ul>
     <cfoutput><cfloop query="rsUserportfolio">
     <tr>
          <td>
               <li>  #vch_AccountNR#
          </td>
          <td>
               <input type="Text" name="PortfolioName#CurrentRow#" value="#vch_PortfolioName#" size="20" maxlength="30">
               <input type="hidden" name="AccountNr#CurrentRow#" value="#vch_accountnr#">
     </tr>
     </cfloop></cfoutput>
</ul>
     <tr>
          <td>
               &nbsp;
          </td>
     </tr>
     <tr>
          <td colspan="2" align="center">
          <cfoutput><input type="hidden" name="PortfolioCount" value="#rsUserPortfolio.RecordCount#"></cfoutput>
               <input type="Submit" name="NamePortfolioSubmit" class="button" value"submit">
          </td>
     </tr>
</table>
</form>

Please help me out on this.

thanks
kanduraStart Free Trial
 
 
[+][-]03.06.2001 at 06:52AM PST, ID: 5903990

View this solution now by starting your 14-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
Sign Up Now!
Solution Provided By: CF_Spike
Participating Experts: 1
Solution Grade: A
 
 
[+][-]03.07.2001 at 07:11AM PST, ID: 5907475

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 14-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20081112-EE-VQP-43