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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Add HTML Table rows dynamically

Status
Not open for further replies.

EAS

Programmer
May 21, 2001
25
GB
I have an HTML table that is populated from a multiple select and query. I need users to be able to add items to the resulting table dynamically without me adding x number of blank rows in case. This is my code to create the table:

<cfquery datasource=&quot;ABCBulkDB&quot; name=&quot;ItemListQ&quot;>
select * from Items_Matrix
where ItemMat_id in (#form.items#)
</cfquery>

<form action=&quot;BItemChoice.cfm&quot; method=&quot;post&quot;>
<table align=&quot;center&quot; border=&quot;1&quot;>
<tr>
<td width=&quot;300&quot;>Item</td>
<td width=&quot;50&quot;>Number Inc in Charge</td>
<td>Quantity</td>
<td width=&quot;10&quot;>Charge</td>
</tr>
<cfoutput query=&quot;ItemListQ&quot;>
<tr>
<td width=&quot;300&quot;>#ItemMat_Desc#</td>
<td>#ItemMat_RuleVal#</td>
<td><input type=&quot;Text&quot; name=&quot;Qty&quot; size=&quot;10&quot;></td>
<td width=&quot;10&quot;>#ItemMat_Charge#</td>
<td><input type=&quot;Checkbox&quot; name=&quot;Chk1&quot;></td>
</tr>
</cfoutput>
<tr>
<td width=&quot;300&quot;><input type=&quot;Text&quot; name=&quot;ItemDesc&quot; size=&quot;50&quot;></td>
<td><input type=&quot;Text&quot; name=&quot;Rule&quot; size=&quot;8&quot;></td>
<td><input type=&quot;Text&quot; name=&quot;Qty&quot; size=&quot;10&quot;></td>
<td width=&quot;10&quot;><input type=&quot;Text&quot; name=&quot;Chge&quot; size=&quot;10&quot;></td>
<td><input type=&quot;Checkbox&quot; name=&quot;Chk1&quot;></td>
</tr>
</table>
</form>


any help will be gratefully recieved
Liz
 
Can you rephrase the question..? I dont understand what you mean.
 
the user sees a table that contains a list of items for collection (bulk collection of rubbish)that they have chosen from a select list. I need the table to grow dynamically as someone asks for something new to be collected

For example - Bath, Door, Tyres might already be available on the pick list and therefore appear on their table but they might also require a settee and 2 armchairs to be collected. I want them to be able to enter their additional items into rows at the bottom of the table without me having to supply x number of blank rows 'in-case'.

Hope this is clearer and thanks for responding
Liz
 
Maybe there's javascript available.. well I know there is that'll let a user add something to a list box via a text box and then remove it again if they want.. Is that what you're getting at?

Maybe had scripts that will do it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top