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

Add new line item

Status
Not open for further replies.

wendyowens

Programmer
Jan 27, 2003
9
US
I have an order form I am creating in Ultradev. The default form shows room for entering only one line item (one row of textboxes for entering data). I would like to create an "add new line item" button and row of textboxes to the form if the user has more than one item they want to order.. I would like this to expand as necessary.

One textbox has an autonumber (item#)
One has an equation that takes unit cost * quantity to generate the total

When I try to create a new line, the autonumber and total cost doesn't generate but the new row does. How can I get it to populate additional rows with the autoinformation?

Thanks
 
I saw the other post regarding autonumber.

Question really first - it may answer the rest.

Why autonumber with ASP when Access does it behind the scenes and flawlessly? "Never underestimate the power of determination"

Stuart
 
This autonumber is different. This autonumber is like a list where when you add a new line it automatically numbers the next line for you.
1.
2.
3.
etc.

I am not using Access. I am using Oracle. Any ideas?
 
lets see your code for adding a new row
"Never underestimate the power of determination"

Stuart
 
this is the code for the row I would like to duplicate as many times as necessary. The first column I would like to autonumber starting with number 1 for the number of line items for this order.

The second row in this table is for the grand total. I would like to be able to automatically add the totals from each row and populate this textbox with the grand total for the order.

Any help you can give is appreciated. Thanks

<table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot; id=&quot;Detail&quot; bordercolor=&quot;#000000&quot;>
<tbody>
<tr bgcolor=&quot;#f1e5de&quot; bordercolor=&quot;#996633&quot;>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>Item
#</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>Part
Number</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>Description</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>Manufacturer/Vendor</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>QTY/Per</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>UOM</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>LT</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>Est.
Unit Cost</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>Qty</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>Total
Cost</font></div>
</td>
</tr>
<tr bgcolor=&quot;#f1e5de&quot; bordercolor=&quot;#996633&quot;>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<input type=&quot;text&quot; name=&quot;ed_ItemNbr&quot; size=&quot;2&quot; value=&quot;1&quot;>
</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<input type=&quot;text&quot; name=&quot;ed_MRPPartNbr&quot; size=&quot;10&quot;>
</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<textarea name=&quot;ed_PartDesc&quot; cols=&quot;20&quot;></textarea>
</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<input type=&quot;text&quot; name=&quot;ed_VendorName&quot; size=&quot;10&quot;>
</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<input type=&quot;text&quot; name=&quot;ed_QtyPerAssy&quot; size=&quot;3&quot;>
</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<input type=&quot;text&quot; name=&quot;ed_UofM&quot; size=&quot;4&quot;>
</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<input type=&quot;text&quot; name=&quot;ed_LeadTime&quot; size=&quot;4&quot;>
</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<input type=&quot;text&quot; name=&quot;ed_UnitPrice&quot; size=&quot;8&quot; onChange=&quot;add();&quot; value=&quot;&quot;>
</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<input type=&quot;text&quot; name=&quot;ed_Qty&quot; size=&quot;5&quot; onChange=&quot;add();&quot; value=&quot;&quot;>
</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<input type=&quot;text&quot; name=&quot;total&quot; size=&quot;5&quot; value=&quot;&quot; disabled>
</font></div>
</td>
</tr>
</tbody>
</table>

 
ON top of your table, put this table and form.


<form name=&quot;form3&quot; method=&quot;get&quot; action=&quot;mynextpage.asp&quot;>
<table width=&quot;95%&quot; border=&quot;1&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; bgcolor=&quot;#f1e5de&quot; bordercolor=&quot;#996633&quot;>
<tr>
<td valign=&quot;middle&quot;>
<div align=&quot;center&quot; class=&quot;bodytextbold&quot;>Select number of
rows to show and refresh this page:
<input type=&quot;hidden&quot; name=&quot;txtLeadID&quot; Value=&quot;15&quot;>
<input type=&quot;hidden&quot; name=&quot;txtEmailID&quot; Value=&quot;14&quot;>
<input type=&quot;hidden&quot; name=&quot;txtHistoryID&quot; Value=&quot;&quot;>
<input type=&quot;hidden&quot; name=&quot;txtStatus&quot; Value=&quot;&quot;>
<select name=&quot;txtFileCount&quot;>
<option value=&quot;1&quot;>1</option>
<option value=&quot;2&quot;>2</option>
<option value=&quot;3&quot;>3</option>
<option value=&quot;4&quot;>4</option>
<option value=&quot;5&quot;>5</option>
<option value=&quot;6&quot;>6</option>
<option value=&quot;7&quot;>7</option>
<option value=&quot;8&quot;>8</option>
<option value=&quot;9&quot;>9</option>
<option value=&quot;10&quot;>10</option>
</select>
<input type=&quot;submit&quot; name=&quot;Submit3&quot; value=&quot;Submit&quot;>
</div>
</td>
</tr>
</table></form>


The particular table row code.

Change to


<% For i = 1 to strRowCount %>
<tr bgcolor=&quot;#f1e5de&quot; bordercolor=&quot;#996633&quot;>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<input type=&quot;text&quot; name=&quot;ed_ItemNbr<%=i%>&quot; size=&quot;2&quot; value=&quot;1&quot;>
</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<input type=&quot;text&quot; name=&quot;ed_MRPPartNbr<%=i%>&quot; size=&quot;10&quot;>
</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<textarea name=&quot;ed_PartDesc<%=i%>&quot; cols=&quot;20&quot;></textarea>
</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<input type=&quot;text&quot; name=&quot;ed_VendorName<%=i%>&quot; size=&quot;10&quot;>
</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<input type=&quot;text&quot; name=&quot;ed_QtyPerAssy<%=i%>&quot; size=&quot;3&quot;>
</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<input type=&quot;text&quot; name=&quot;ed_UofM<%=i%>&quot; size=&quot;4&quot;>
</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<input type=&quot;text&quot; name=&quot;ed_LeadTime<%=i%>&quot; size=&quot;4&quot;>
</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<input type=&quot;text&quot; name=&quot;ed_UnitPrice<%=i%>&quot; size=&quot;8&quot; onChange=&quot;add();&quot; value=&quot;&quot;>
</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<input type=&quot;text&quot; name=&quot;ed_Qty<%=i%>&quot; size=&quot;5&quot; onChange=&quot;add();&quot; value=&quot;&quot;>
</font></div>
</td>
<td>
<div align=&quot;center&quot;><font face=&quot;Arial, Helvetica, sans-serif&quot; size=&quot;1&quot;>
<input type=&quot;text&quot; name=&quot;total<%=i%>&quot; size=&quot;5&quot; value=&quot;&quot; disabled>
</font></div>
</td>
</tr>
<% NEXT %>


That will make your text fields like total1, total2, etc.

&quot;Never underestimate the power of determination&quot;

Stuart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top