|
Post by kokenge on Feb 13, 2008 20:53:18 GMT -5
I have a typical order enter form. It has ship to, sold to etc. no problem.
The order lines consist of item number, description, quantity, price, and price extension. Typically the order will have from 5 to 20 items displayed on the form.
My question - What is the best way to do the multi line input. I don't see where I can put a index on the handle such as; textbox #itemNum(i), itemNum(i). If they hit the [Accept] key, What is the best way to do a loop to process all 20 line items, prices, and etc.
Thanks for the help..
|
|
|
Post by carlgundel on Feb 13, 2008 22:03:45 GMT -5
Are you looking to have a table containing each line entry, and a form that appears when you want to add a new one? -Carl I have a typical order enter form. It has ship to, sold to etc. no problem. The order lines consist of item number, description, quantity, price, and price extension. Typically the order will have from 5 to 20 items displayed on the form. My question - What is the best way to do the multi line input. I don't see where I can put a index on the handle such as; textbox #itemNum(i), itemNum(i). If they hit the [Accept] key, What is the best way to do a loop to process all 20 line items, prices, and etc. Thanks for the help..
|
|
|
Post by carlgundel on Feb 13, 2008 22:50:35 GMT -5
Did you look at the buggsCSS example that comes with Run BASIC?
-Carl
|
|
|
Post by Brent on Feb 14, 2008 2:56:54 GMT -5
If you want to create widgets in a loop, you can use the old-style handle variable.
dim a$(10) ' create #txt1, #txt2, etc. for i=1 to 10 txt.i$="#txt";i textbox #txt.i$, i print next link #submit,"Submit",[submit] wait
[submit]
for i=1 to 10 txt.i$="#txt";i a$(i)=#txt.i$ contents$() next
cls for i=1 to 9 print a$(i);", "; next print a$(10)
end
|
|
|
Post by kokenge on Feb 14, 2008 7:31:31 GMT -5
Thanks for the help. Looks like the code Brent posted will work for me. Where is the doc's on this code?? If I decide I need it more interactive, I may have to do a little JavaScript. So when they change (onChange) the price, item number, quantity, price etc. it will compute the other values. But a batch solution may work just fine. I'll probably do something like this. html "<TABLE BORDER=1><TR><TD><CENTER>" html "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100% BGCOLOR=tan>" html "<TR><TD WIDTH=100% ALIGN=center>Order Entry</TD></TR></TABLE>"
html "<TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>" html "<TR>" html "<TD WIDTH=50% BGCOLOR=tan ALIGN=center>Ship To</TD>" html "<TD WIDTH=50% BGCOLOR=tan ALIGN=center>Sold To</TD>" html "</TR><TR>" html "<TD>Ship name<BR>Address</TD>" html "<TD>Sold Name<BR>Address</TD>" html "</TR>" html "</TABLE>"
html "<TABLE BORDER=1 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>" html "<TR BGCOLOR=tan>" html "<TD ALIGN=center>"
link #add, "Add", [doItemAdd]
html "</TD>" html "<TD ALIGN=center>Item Number</TD>" html "<TD ALIGN=center>Description</TD>" html "<TD ALIGN=center>Quantity</TD>" html "<TD ALIGN=center>Unit Price</TD>" html "<TD ALIGN=center>Total Price</TD>" html "</TR><TR>" for i=1 to 10 html "<TR><TD>" link #del, "Del", [doItemDel] #del SETKEY(i) html "</td><td>"
txt.i$="#txt";i textbox #txt.i$, i
html "</td><td>Description for: ";i html "</td><td>"
qty.i$="#qty";i textbox #qty.i$, i * 2
html "</td><td>"
price.i$="#price";i textbox #price.i$, i * 5
html "</td><td>"
tot.i$="#tot";i textbox #tot.i$, (i * 2) * (i * 5)
html "</TR>" next i
html "</TR></TABLE>"
link #submit,"Submit",[submit] wait
[submit] dim a$(10) dim q$(10) dim p$(10) dim t$(10)
for i=1 to 10 txt.i$="#txt";i a$(i)=#txt.i$ contents$()
qty.i$="#qty";i q$(i)=#qty.i$ contents$()
price.i$="#price";i p$(i)=#price.i$ contents$()
tot.i$="#tot";i t$(i)=#tot.i$ contents$() next
cls for i=1 to 10 print a$(i);" | ";q$(i);" | ";p$(i);" | ";t$(i) next wait
[doItemDel] delItem = val(EventKey$) ' GET item to delete print "Code to delete item: ";delItem wait
[doItemAdd] Print "Code to add a item to the list" wait
end
Thanks for all the help.. I'm on my way again...
|
|