I have a page where I can input multiple "orders" on one "invoice". I have three types of orders and each type can be on the invoice multiple times. Right now I write a separate aspx page for each type of order. something like this:
order1.aspx, order2.aspx, order3.aspx are very similar to this:
<form id="order1" runat="server" class="order1">
<asp:Label ID="lblOrder1" runat="server" for="txtOrder1"><b>From:</b></asp:Label>
<asp:TextBox runat="server" type="text" ID="txtOrder1" name="txtOrder1" class="order1"/>
</form>
On the main page, I can click one of 3 buttons to add an order type, with jQuery:
$('#btnOrder1').click(function () { $("#col3").append($("<div>").load("order1.aspx"));});
When I click the order button, it loads up the order form on the page. If I click it again, it loads another. This works fine.
When I click the save button on the invoice page, I need to fill the order objects(three objects, each representing a different type of order) with the values from the correct order and then save it to a database. I have the database saving code done, but I don't know how I can cycle through each order form on the page to fill in the appropriate object. I also need to be able to compare the different instances of each order, so I can check that the dates filled in on the order are not conflicting but I suspect I will be able to do this when I fill the object.