Thanks Justin - that looks like just what I was looking for.  Now I've got
to see if I can make it work with a complex form.

Bob

-----Original Message-----
From: JustinMacCarthy [mailto:[EMAIL PROTECTED]]
Sent: December 13, 2000 10:06 AM
To: CF-Talk
Subject: RE: Unlimited Line Item Subform functionality in a <FORM>


Here is a very quick DHTML example I just knocked up for u.
(ie4 + ) Needs to be changed slightly to be DOM compliant

You need to loop over the 'Form' collection on the "action" page to add each
field (lineitem1,lineitem2 lineitem3 etc....)

Justin MacCarthy

<html>
<head>
<script>
<!--//

currentItem = 1;

function AddLineItem ()
{
        currentItem++;
        e = "<input tye='text' size='20' name='lineitem" + currentItem + "'>";
        lineitems.insertAdjacentHTML("BeforeEnd",e);
}

//-->
</script>


</head>


<body>
<form action="" name="">
<div id=lineitems>
        <input type="text" name="lineitem1" size=20>
</div>
<input type="Button" onclick="AddLineItem()">
</form>
</body>
</html>


>-----Original Message-----
>From: Bob Silverberg [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, December 13, 2000 2:32 PM
>To: CF-Talk
>Subject: Unlimited Line Item Subform functionality in a <FORM>
>
>
>Hi all,
>
>Here's the scenario:  A user is entering an order, the order will have some
>info associated with it, and then the order can have multiple line items
>added to it.  Each line item will have a number of attributes
>(like product,
>quantity, etc.).  In a program like Access, you can create a form for the
>Order, and then create a subform for the line items.  You can easily set it
>up so that the user can enter as many line items as they like.  After they
>enter a line item, the interface adds a new blank line item.
>
>We need to replace an Access application with a ColdFusion application and
>provide this same functionality.  If we have to, we could provide input
>fields for a specific number of line items, and then provide a
>button to add
>more items, but I was wondering if anyone knows of any custom tags, applets
>or ActiveX controls that would provide this functionality.  Or perhaps I'm
>missing an obvious easy solution.
>
>Any suggestions would be greatly appreciated.
>
>Thanks,
>Bob
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to