Skip to main content
Inspiring
May 5, 2008
Question

I do not know or understand how to do this -

  • May 5, 2008
  • 1 reply
  • 243 views
Since I am not a programmer and have very limited knowledge of coldfusion, I post here for help and can sometimes figure things out. But this time, I am stuck and really do not understand any of the suggestions from my original post. So I am posting again, hoping somebody can help me out and show me how to do this.

I use the following code to display all line items from a query, and put in checkboxes for each line item, so that if the box is checked, that line item will be deleted, if all boxes are checekd, all line items are deleted.

<cfoutput query="qry">
<tr>
<td align="center"><input type="checkbox" name="del_#red_number#_#ref_line_item#" value="Yes"></td>
<td align="center">#qry.line_item#</td>
<td align="center">#qry.action#</td>
<td align="center">#qry.quantity#</td>

the action page :

<cfloop index="i" list="#form.fieldnames#" delimiters=",">

<cfif left(i,4) is "del_">
<cfset select_ref_number = listgetat(i, 2, "_")>
<cfset select_ref_line_item = listlast(i, "_")>

processing here, works fine.

What I need to do now is add an extra/new input text field, to each line item displayed, for the user to enter comments explaining why they want to delete that line item. I then need to insert this comment that corresonds to each line item into another table, along with the displayed fields from the query.

Since this comments input text is not part of the query, how do I associate it with each line item/record, when it is inserted into another table ?

Can somebody please show me how to set thit up ?

Thanks in advance for any help.
    This topic has been closed for replies.

    1 reply

    Inspiring
    May 5, 2008
    you associate your text input field with a particular line item exactly
    the same way you associate your checkboxes - by specifying a line number
    in the input's NAME attribute.

    may i also suggest, as has been previously suggested to you in a number
    of your posts, that you give all your checkboxes SAME NAME, and provide
    identifying details in the VALUE attribute. that way your form action
    page will receive a comma-delimited list of selected checkboxes' values,
    which is easier to manipulate than looping through for.fieldnames...

    hth

    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com/