⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 selection.zhtml

📁 Zword公司的Rabbit2000系列相关文件
💻 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 + -