File: ictemplates_35.html

package info (click to toggle)
interchange-doc 4.8.3-1
  • links: PTS
  • area: main
  • in suites: sarge, woody
  • size: 17,396 kB
  • ctags: 4,509
  • sloc: makefile: 46
file content (62 lines) | stat: -rw-r--r-- 3,190 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!doctype html public "-//W30//DTD W3 HTML 2.0//EN">

<HTML>

<!-- This file was generated using SDF 2.001 by
     Ian Clatworthy (ianc@mincom.com). SDF is freely
     available from http://www.mincom.com/mtr/sdf. -->

<HEAD>
<TITLE>Template Guide: Checks and Selections</TITLE>
</HEAD>
<BODY BGCOLOR="ffffff" LINK="993333">

<DIV CLASS="header">
<DIV CLASS="navigate">
<P ALIGN="Center"><A HREF="ictemplates_31.html">Parent Topic</A> | <A HREF="ictemplates_34.html">Previous Topic</A> | <A HREF="ictemplates_36.html">Next Topic</A> <BR><A HREF="../index.html" TARGET="_top">Catalog</A></P>
</DIV>
</DIV>
<DIV CLASS="main">
<H2>8.4. Checks and Selections</H2>
<P>A &quot;memory&quot; for drop-down menus, radio buttons, and checkboxes can be provided with the <TT>[checked]</TT> and <TT>[selected]</TT> tags.</P>
<P><B>[checked var_name value]</B></P>
<UL>
named attributes: <TT>[checked name=&quot;var_name&quot; value=&quot;value&quot; cgi=0|1 multiple=0|1 default=0|1 case=0|1]</TT>
<BR>
This will output CHECKED if the variable <TT>var_name</TT> is equal to <TT>value</TT>. Set the <TT>cgi</TT> attribute to use cgi instead of values data. Not case sensitive unless <TT>case</TT> is set.
<BR>
If the <TT>multiple</TT> attribute is defined and set to a non-zero value (1 is implicit) and if the value matches on a word/non-word boundary, it will be CHECKED. If the <TT>default</TT> attribute is set to a non-zero value, the box will be checked if the variable <TT>var_name</TT> is empty or zero.</UL>
<P><B>[selected var_name value]</B></P>
<UL>
named attributes: <TT>[selected name=&quot;var_name&quot; value=&quot;value&quot; cgi=0|1 multiple=0|1 default=0|1 case=0|1]</TT>
<BR>
This will output SELECTED if the variable <TT>var_name</TT> is equal to <TT>value</TT>. Set the <TT>cgi</TT> attribute to use cgi instead of values data. Not case sensitive unless <TT>case</TT> is set.
<BR>
If the <TT>multiple</TT> argument is present, it will look for any of a variety of values. If the <TT>default</TT> attribute is set, SELECT will be output if the variable is empty or zero. Not case sensitive unless <TT>case</TT> is set.
<BR>
Here is a drop-down menu that remembers an item-modifier color selection:</UL>
<PRE>
            &lt;SELECT NAME=&quot;color&quot;&gt;
            &lt;OPTION [selected name=color value=blue]&gt; Blue
            &lt;OPTION [selected name=color value=green]&gt; Green
            &lt;OPTION [selected name=color value=red]&gt; Red
            &lt;/SELECT&gt;
</PRE>
<UL>
For databases or large lists of items, sometimes it is easier to use <TT>[loop list=&quot;foo bar&quot;]</TT> and its <TT>option</TT> parameter. The above can be achieved with:</UL>
<PRE>
            &lt;SELECT NAME=color&gt;
            [loop list=&quot;Blue Green Red&quot; option=color]
            &lt;OPTION&gt; [loop-code]
            [/loop]
            &lt;/SELECT&gt;
</PRE>
</DIV>
<DIV CLASS="footer">
<DIV CLASS="navigate">
<P ALIGN="Center"><A HREF="ictemplates_31.html">Parent Topic</A> | <A HREF="ictemplates_34.html">Previous Topic</A> | <A HREF="ictemplates_36.html">Next Topic</A> <BR><A HREF="../index.html" TARGET="_top">Catalog</A></P>
</DIV>
</DIV>

</BODY>
</HTML>