?? selection.zhtml
字號:
<!-- This file shows how to use selection variables in ZHTML scripting. See
the tags in the <FORM> ... </FORM> section. -->
<HTML>
<HEAD>
<TITLE>Selection Variables</TITLE>
</HEAD>
<BODY>
<H1>Selection Variables</H1>
<FORM ACTION="/index.zhtml" METHOD="POST">
<TABLE>
<!-- The following row in the table is for the color variable -->
<TR>
<TD>Color</TD>
<TD>
<!-- The SELECT tag is an HTML tag for a pulldown menu. -->
<SELECT NAME="color">
<!-- The following code prints out the option list for the selection variable.
The for loop loops over each option. count($color) means the number of
options in the selection varible. -->
<?z for ($A = 0; $A < count($color); $A++) { ?>
<!-- Check if the current ($A) option is selected, and output the string
"SELECTED" if so -->
<OPTION
<?z if (selected($color, $A)) { ?>
SELECTED
<?z } ?>
>
<!-- Print out the string value corresponding to the current option -->
<?z print_opt($color, $A) ?>
<?z } ?>
<!-- End the selection tag -->
</SELECT>
</TD>
</TR>
<!-- The following row in the table is for the city variable -->
<TR>
<TD>City</TD>
<TD>
<!-- Another SELECT tag, this time for the city -->
<SELECT NAME="city">
<!-- The following generates the option list appropriately for a SELECT HTML
element automatically. Note that the technique used for the color variable
is still useful in that it allows more flexibility. For example, a set
of radio buttons could be generated rather than a pulldown menu. -->
<?z print_select($city) ?>
</SELECT>
</TD>
</TR>
</TABLE>
<P>
<INPUT TYPE="submit" VALUE="Submit">
<INPUT TYPE="reset" VALUE="Reset">
</FORM>
</BODY>
</HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -