2022.2

Table Of Contents
n
Etcetera.Seehttps://www.w3schools.com/cssref/css_selectors.aspformoreselect-
orsandcombinationsofselectors;alsosee"SelectorsinOLConnect"onpage385
forselectorsthatcanonlybeusedinOLConnect.
l
Aselector and text.ThisistextinsideanHTMLelement(orseveralHTMLelements)with
aspecificHTMLtag,CSSclassorID.IntheScriptWizard,clickSelector and Text.
Tip: Whenoutputspeedmatters,chooseselectororselector and text.Searchingtextis
aratherlengthyoperation,comparedtosearchingforHTMLelementsand/orCSSselect-
ors.Seealso:"Optimizingscripts"onpage380.
Quick-startascriptforaspecificIDorclass
ThereisashorterroutetocreateascriptforanelementwithaspecificIDorclass:
1. IntheOutlinepaneattheleft,clicktheelementforwhichyouwanttocreateascript.
2. OntheAttributespaneatthetopright,typeanIDorclass.
3. OntheAttributespane,clickthelabeltotheleftoftheIDorClassinputfield(IDorClass)to
makeanewscriptwiththatIDorclassasselector.
Drag-and-dropadatafieldtostartascript
Hereisanotherwaytostartascriptwithaclassselector.
1. Right-clickasectionintheResourcespaneandselectProperties.
2. UnchecktheoptiontoEvaluateHandlebarsexpressionsandclickOK.
3. Openthatsectionanddrag-and-dropadatafieldfromtheDataModelintothecontent.
Whathappensisthat:
o
Aplaceholderforthevalueofthedatafieldshowsupinthetext.Itlooksasfollows:
@FIELDNAME@.
o
AscriptappearsintheScriptspaneatthebottomleft.
Thescriptreplacestheplaceholdersinthecontentwiththevalueofadatafieldinthecurrentrecord.
AslongastheoptionEvaluateHandlebarsexpressionsisinactive,drag-and-dropwillcreateascript
andinsertaplaceholderthatlookslikethis:@fieldname@.Whentheoptionisactive,drag-and-drop
insertsanexpressionlike{{fieldname}}.
Writing a script
1. Createanewscript(see:"CreatinganewStandardScript"onthepreviouspage,"AddingaCon-
trolScript"onpage398or"AddingaPostPaginationScript"onpage411),ordouble-clickan
Page 371