Submit from list

Posted on 2009-04-03
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">
                  <td height="24"><input name="customer_no" value="Continue" type="submit">#getSupplies.customer_no# - #getSupplies.ship_to# - #getSupplies.scity# - #getSupplies.sstate#</a></td>
            <input type=hidden name="customer_no" value="#getSupplies.customer_no#">
Question by:usky1
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
LVL 39

Accepted Solution

gdemaria earned 350 total points
ID: 24059365
use javascript to assign the value of the selected button before submitting
<table border="0">
<cfloop query="getSupplies">
	<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#
<input type="hidden" id="custNo" name="customer_no" value="">

Open in new window

LVL 39

Expert Comment

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

Author Comment

ID: 24060612
That worked great.

Author Closing Comment

ID: 31566220
Thanks for the quick reply and solution.

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

707 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