Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
setFocus
System
I'm using TS 6.5 SP1...
I can't get my setFocus to work...here's the code:
DCT:
<container location="Story_Idea" name="Story_Idea">
<label>Story Idea</label>
<item name="Start_Date">
<label>Start Date</label>
<description>Date you started to fill out the template. Format is MM/DD/YYYY.</description>
<text required="t" maxlength="10" validation-regex="^[0-1]?[0-9]/[0-3]?[0-9]/[0-9][0-9][0-9][0-9]$">
<cgi-callout url="/iw-bin/iw_cgi_wrapper.cgi/dct_calendar.ipl" label="Calendar"
window-features="width=200,height=230,resizable=no,toolbar=no,scrollbars=no,titlebar=no"/>
</text>
</item>
<item name="Writer">
<label>Writer</label>
<description>Your name.</description>
<text required="t" size="20"/>
</item>
JavaScript:
function init() {
focusItem = IWDatacapture.getItem("/Story_Idea/Writer");
focusItem.setFocus();
}
It looks like it's returning [IWItem text /Story_Idea/Writer].
Any thoughts or suggestons! Is my setFocus code wrong?
Find more posts tagged with
Comments
JonathonG
What is triggering your init function? In the code you posted, I don't see any way for it to be triggered. Did you register it for onFormInit or are you calling it directly? If the latter, change to the former. Sometimes, if the javascript runs too early the setFocus will appear to be a no-op, when what has really happened is that focus got set by your code, then the form load stuff re-set it somewhere else.
Jonathon
Interwoven Developer
Allstate, Inc.
Nidhi_Agrawal
Use this DCT..
<script language="javascript" >
IWEventRegistry.addFormHandler("onFormInit", init);
function init() {
focusItem = IWDatacapture.getItem("/Story_Idea/Writer");
focusItem.setFocus();
}
</script>
<container location="Story_Idea" name="Story_Idea">
<label>Story Idea</label>
<item name="Start_Date">
<label>Start Date</label>
<description>Date you started to fill out the template. Format is MM/DD/YYYY.</description>
<text required="t" maxlength="10" validation-regex="^[0-1]?[0-9]/[0-3]?[0-9]/[0-9][0-9][0-9][0-9]$">
<cgi-callout url="/iw-bin/iw_cgi_wrapper.cgi/dct_calendar.ipl" label="Calendar"
window-features="width=200,height=230,resizable=no,toolbar=no,scrollbars=no,titlebar=no"/>
</text>
</item>
<item name="Writer">
<label>Writer</label>
<description>Your name.</description>
<text required="t" size="20"/>
</item>
</container>