1.8

Table Of Contents
This script iterates over rows in a detail table and adds the contents of the 'country' field to a
paragraph.
for(var i in record.tables['countries']) {
results.after("<p>" + record.tables['countries'][i].fields
['country'] + "</p>");
}
Selector Matched element Matched element after script
execution
#countries <h1
id="countries">Countries</h1>
<h1 id="countries">Countries</h1>
<p>The Netherlands</p>
<p>Canada</p>
<p>Australia</p>
This script iterates over rows in a detail table and adds the contents of the 'ItemID2' field to an
option. The <option> tag defines an option in a select list in an HTML form.
for(var i in record.tables['detail']) {
var str = record.tables['detail'][i].fields["ItemID2"];
results.append("<option value='" + str + "'>" + str +
"</option>");
}
formatter
The formatter is a global object that allows you to format values in a script.
The Text Script Wizard also allows you to format variable data; see "Using the Text Script
Wizard" on page607 and "Formatting variable data" on page610.
Note
The TextFormatter object is now deprecated and will eventually be removed.
Page 912