Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Datacapture.cfg and Form API
Annad
Hi,
I am trying to call a javascript file from a datacapture using the cgi-callout element.
Here is my datacaputre.cfg file content.
--------------------------------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE datacapture SYSTEM "datacapture6.0.dtd">
<data-capture-requirements type="content" name="wireframe">
<ruleset name="TeamSite Templating">
<item name="myButton">
<hidden>
<cgi-callout label="My Button"/>
</hidden>
</item>
<script src="test.js"/>
</ruleset>
</data-capture-requirements>
---------------------------------------------------------------------------
Here is the test.js file content.
function init () {
alert(“Hi Anna”);
//Then you register you EventHandlers in this function
IWEventRegistry.addItemHandler("/myButton", "onCallout", sayHello);
}
function sayHello () {
alert(“inside sayHello function”);
}
IWEventRegistry.addFormHandler("onFormInit", init);
-------------------------------------------------------------------------
The js file is saved in the same folder as the datacapture.cfg file.
However, when I clik on the button, the alert box does not come up.
Any ideas why???
Thanks in advance.
Anna
Find more posts tagged with
Comments
cliffhanger
Are you getting the first alert?
alert(“Hi Anna”);
In your script tag add location attribute.
<script location="template-type" src="test.js"/>
. If you don't specify the location type, it assumes it to be "webserver" so looks for it under iw-home\httpd folder.
By the way, there's a forum for Templating so posting your templating related questions there might help you get help quicker.