Skip to main content

This is documentation for Caché & Ensemble. See the InterSystems IRIS version of this content.Opens in a new tab

For information on migrating to InterSystems IRISOpens in a new tab, see Why Migrate to InterSystems IRIS?

ドロップダウン・リストの追加

次に、大人用と子供用のチケットの枚数を選択できる、2 つのドロップダウン・リストを追加します。(ここではスペースの関係で大人用だけを示します。)

まず始めに、<select> タグを追加します。HTML ではこれをリストに使用します。<select> 内には、リストの各エントリに対する <option> タグがあります。チケットを 9 枚まで購入できるようにするため、10 のエントリを生成する <csp:loop> タグを使用します。

—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>
    <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">
            <csp:loop counter="i" from=0 to=9>
                <option> #(i)# </option>
            </csp:loop>
        </select>Adult Tickets<br>

    </csp:loop>
</csp:if>
</body> </html>
FeedbackOpens in a new tab