?
Solved

Submit from list

Posted on 2009-04-03
4
Medium Priority
?
186 Views
Last Modified: 2013-12-24
I have a loop query that I need to submit the value from the selected value.
For example if the query comes back with 20 rows of information and I select the 5 row. it always gives me the result from the first row. How can I get it to supply the customer_no for the the one I selected?
<table border=0>
      <cfloop query="getSupplies">
            <cfoutput>
                  <tr>
                  <td height="24"><input name="customer_no" value="Continue" type="submit">#getSupplies.customer_no# - #getSupplies.ship_to# - #getSupplies.scity# - #getSupplies.sstate#</a></td>
                  </tr>
            <input type=hidden name="customer_no" value="#getSupplies.customer_no#">
            </cfoutput>
      </cfloop>
</table>
0
Comment
Question by:usky1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 39

Accepted Solution

by:
gdemaria earned 1400 total points
ID: 24059365
use javascript to assign the value of the selected button before submitting
<table border="0">
<cfloop query="getSupplies">
 <cfoutput>
  <tr>
	<td height="24">
	   <input name="customer_no" value="Continue" type="submit" onClick="documents.getElementById('custNo').value='#getSupplies.customer_no#'">
       #getSupplies.customer_no# - #getSupplies.ship_to# - #getSupplies.scity# - #getSupplies.sstate#
	</td>
  </tr>
</cfoutput>
</cfloop>
</table>
<input type="hidden" id="custNo" name="customer_no" value="">

Open in new window

0
 
LVL 39

Expert Comment

by:gdemaria
ID: 24059370
notice there is only one customer_no field, a hidden one, outside of the loop

when you click the submit, the value gets assigned into that field and submitted
0
 

Author Comment

by:usky1
ID: 24060612
That worked great.
0
 

Author Closing Comment

by:usky1
ID: 31566220
Thanks for the quick reply and solution.
0

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month10 days, 12 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question