Skip to main content

Adding a <FORM> Tag

Strictly speaking, we should always put <select> tags, and other form elements, within a <form> tag. (Some browsers are forgiving about this, but others are not, so it's good practice to add the <form> tag.)

For now, we'll add a <form> tag with a name of “OrderTickets”.

—Order.csp—
Order.csp
<html> <head></head>
<body>
<csp:class super="%CSP.Page,Cinema.Utils">
<csp:if condition='$D(%session.Data("Order"))'>
    <img src="YourTicketOrder.gif"><br>
    <script language="cache" runat="server">
        // Open Order object for display
        Set ord = ##class(Cinema.TicketOrder).%OpenId(%session.Data("Order"))
    </script>
    <form name="OrderTickets">
    <csp:loop counter="num" from=1 to=#(ord.Items.Count())#>
        <script language="cache" runat="server">
            Set itm = ord.Items.GetAt(num)
        </script>
        For the #($ZT(itm.Show.StartTime,4))#
        showing of #(itm.Show.Film.Title)#
        at #(itm.Show.Theater.TheaterName)#
        <br><br>
        <select name="AdultTickets">
        ... 
        </select>
        <select name="ChildTickets">
        ... 
        </select>
    </csp:loop>
    </form>
</csp:if>
</body> </html>
FeedbackOpens in a new tab