Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get name of radio in form dynamically

Status
Not open for further replies.

joelxez

Programmer
Apr 18, 2002
67
PH
hi experts,


any one who can correct this.....

Element ITEMS is undefined in a Java object of type class [Ljava.lang.String; referenced as


<cfoutput query="products">

<tr class="maintxt" align="center" bgcolor="">
<td><input type="radio" name="items#customertransactionID#" value="in" checked></td>
<td><input type="radio" name="items#customertransactionID#" value="out" ></td>
<td>#gearname#</td>
<td>#size#</td>
<td>#quantity#</td>
<td>#totalprice#</td>
</tr>

</cfoutput>


----------------------------------------


Action page

<cfquery name="cust" datasource="travelgear_read">
SELECT MAX(customertransactionID) AS cID FROM b_tbcustomertransaction
</cfquery>


<cfoutput>
<cfloop from="1" to="#cust.cID#" index="i">
#form.items#
</cfloop>
</cfoutput>
 
It seems that you chopped out a lot of your code.. Ouch that makes it hard to help sometimes.. but try this.

In your form page:

Code:
<cfoutput query="products">
  <tr class="maintxt" align="center" bgcolor=""> 
    <td><input type="radio" name="items_#customertransactionID#" value="in" checked></td>
    <td><input type="radio" name="items_#customertransactionID#" value="out" ></td>
    <td>#gearname#</td>
    <td>#size#</td>
    <td>#quantity#</td>
    <td>#totalprice#</td>
  </tr>
</cfoutput>
<cfoutput><input type="hidden" name="cids" value="#valuelist(products.customertransactionID)#"></cfoutput>

It is important that the hidden field remain within the boundaries of your form tag but outside of your records-cfoutput. We want the value, but we only want it once, not once with each record.

In your action page:

Code:
<cfoutput>
  <cfloop list="#cIDs#" index="cID">
    #listgetat(FORM["items_" & cID])#
  </cfloop>    
</cfoutput>

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top