|
ION Script User's Guide: ION Script Tag Reference |
|
The ION_LINK tag is used to create a text hyperlink to another .ion page. Unlike an HTML hyperlink, the ION_LINK allows you to pass all persistent variables to the destination page. ION_LINK also allows you to assign a value to the link, and pass that value to the destination page, where it can be accessed as a form variable.
<ION_LINK
EVENT="eventName"
[TARGET="frame target"]
[NAME1="name" VALUE1="value"]
. . .
[NAMEn="name" VALUEn="value"] >
Link Text (can be HTML)
</ION_LINK>
The name of the EVENT_DECL to execute when the user clicks on the link. This name must be one of the names defined in the NAME attribute of an EVENT_DECL tag. This attribute can contain a variable.
The name of the value to pass to the destination page. The first NAMEn must be NAME1, and subsequent names must be consecutively numbered. NAME1 corresponds to the value passed in VALUE1. As with form fields, this name becomes a $Form variable named $Form.NAME. This attribute can contain a variable.
The name of the window or frame in which to load the URL specified by the EVENT attribute when the link is clicked. This attribute can be set to either the NAME attribute of an HTML <FRAME> or <IFRAME> tag, or to one of four predefined windows: _blank, _parent, _self, or _top. See Targeting Different Frames for a description of these predefined windows. See Overview of Fixed Framesets for an example of how to use the TARGET attribute.
A value that is passed to the destination page. The first VALUEn must be VALUE1, and subsequent values must be consecutively numbered. VALUE1 corresponds to the value named NAME1. This value can be accessed on the destination page as $Form.NAME, where NAME is the NAMEn attribute corresponding to this value. This attribute can contain a variable.
The ION_LINK tag is converted to the HTML <A> tag. EVENT, TARGET, and VALUEn are used in the construction of the URL specified as the value of the HREF attribute of the <A> tag. Any HTML nested inside the <ION_LINK>...</ION_LINK> block is passed to the browser unchanged.
Create two links, and pass the value of the clicked link to the destination page. By giving each link the same name, we can use these links in the same way we use radio buttons. Note that the value of the clicked link is accessed using the $Form variable:
page1.ion:
<ION_SCRIPT> <ION_HEADER> <EVENTS> <EVENT_DECL NAME="PAGE2" ACTION="ion://page2.ion"/> </EVENTS> </ION_HEADER> <ION_BODY> <ION_LINK EVENT="PAGE2" NAME1="Link" VALUE1="One">Link 1 </ION_LINK><BR> <ION_LINK EVENT="PAGE2" NAME1="Link" VALUE1="Two">Link 2 </ION_LINK> </ION_BODY> </ION_SCRIPT>
page2.ion:
<ION_SCRIPT> <ION_BODY> <ION_IF EXPR="$Form.Link EQ 'One' "> <B>You selected link 1</B> <ION_ELSE/> <B>You selected link 2</B> </ION_IF> </ION_BODY> </ION_SCRIPT>
For another example of how the VALUE attribute of an ION_LINK can be used, see Example 2.
IDL Online Help (March 06, 2007)