@wuiExampleLoad(FORM ID, FIELD, LOAD, [DISPLAY], [URL], [TITLE], [VALIDATE])

Shows text in document and loads text into form if user clicks on it.

The following parameters are recognized:

FORM ID

The form ID of the input field to update.

FIELD

The form field to update.

LOAD

The value to load into the form field.

[DISPLAY]

What to display in the document (defaults to LOAD).

[URL]

Optional URL to jump to if clicked.

[TITLE]

Optional mouse over title description.

[VALIDATE]

Optional javascript code to validate field after load insertion.

This macro allows one to insert text into the document which the end user can click on. When the end user clicks on the text, the example value provided will be loaded into the referenced form field. If a DISPLAY value is included, it will appear as the clickable link, otherwise, the actual value loaded will appear. If a URL is passed, it will be jumped to when the user clicks.

Example of using the macro:

<div id="anchor"></div>
<form name="aform">
  <input name="afield" type="text" value="" />
</form>

@p("Try @wuiExampleLoad("aform.afield","Purple Coconuts",,"#anchor") for
your @wuiExampleLoad("aform.afield","Purple Coconuts","breakfast") today.")

Assuming the com.ccg.macros.at.All class is within your CLASSPATH and the config/html.at macros file has been generated (Hint: run make atmacros in the wui directory), a developer should be able to run the above example by copy/pasting from below:

[root@probe root]# java com.ccg.macros.at.All <<EOF
@include("config/html.at",,"d")

<div id="anchor"></div>
<form name="aform">
  <input name="afield" type="text" value="" />
</form>

@p("Try @wuiExampleLoad("aform.afield","Purple Coconuts",,"#anchor") for
your @wuiExampleLoad("aform.afield","Purple Coconuts","breakfast") today.")

EOF

This macro is defined as:

@htmlEntity("a","@fnb("@param(3)","@param(2)")","
@ifEqual("@param(5)",,,"@toolTipAttr("@param(5)")")
@ifEqual("@param(4)","","@htmlAttr("style","cursor: pointer; white-space: nowrap;")","@htmlAttr("href","@param(4)")")
@htmlAttr("onclick","document.getElementById('@param(0)').@param(1).value='@param(2)'; NstDom.setCursorFocusEnd(document.getElementById('@param(0)').@param(1));@ifEqual("@param(6)","",""," @param(6)")")")