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)
javascript with Datacapture
manju166
Can we use javascript inside datacapture.cfg.
I am trying to insert date field in multiple items of a news item.
I can use inline and callout methods but when ever a dcr is in edit mode it displays the current date and i loose the previous date.
Can any one show me the syntax for using javascript in datacapture.cfg file.
Thankyou
Manju
Find more posts tagged with
Comments
james1
TST5.5.2 includes a new feature, FormAPI, that allows you to write JavaScript to manipulate the data capture form. Please see your manuals for more information and examples.
--
James H Koh
Interwoven Engineering
manju166
I cannot use Form API's as I am using 5.0.1 on windows NT.
Is there any other way
Thanks for your response
manju
akshathp
Could you not have the date information entered into Generated output via the *tpl* file? I suggest that as in tpl you could use javascript or PERL to fetch the information that you require. And for the DCR the date will be there in the EAs anyways.
Hope this helps!
Akshat Pramod Sharma
Interwoven Inc.
ZebraSP5[gsdata].pdf
soka
> when ever a dcr is in edit mode it displays the current date
> and i loose the previous date.
Have you used <default> to set the initial date? Than when you open up it next time the previously saved date will come up.
Akos
manju166
I want my date to display in the format below
Wednesday, September 25, 2002 10:18 am EST.
If I use the date script in the template .tpl , it gives me the date when the tempalte got generated.
For example:
I have a news article with 5 replicants, if 1st replicant was published yesterday and the another one today the tempalte takes today's date for both the items and I loose previous date for the first replicant
I havent used default, my date field in datacapture.cfg is
<item name="current date">
<label>Date</label>
<select required="t">
<inline command="d:/iw-home/iw-perl/bin/iwperl.exe d:/iw-home/custom/bin/currentdate.ipl"/>
</select>
</item>
I tried to insert <default> tag in the <select> tags but it is not working
<select required="t">
<deafult>
<inline command="d:/iw-home/iw-perl/bin/iwperl.exe d:/iw-home/custom/bin/currentdate.ipl"/>
<default>
</select>
so how do i use the <default> in my date field.
can you please be more specific.
Thanks
Manju
Edited by manju166 on 11/04/02 06:58 AM (server time).
Adam Stoller
Although it's not my area of expertise - I believe FormAPI would serve you better than an inline for this.
I think you'd want to set a read-only value for creation (or modification) date per replicant (at least it sounds like you want to do this on a per-replicant basis). Using an onSave event to look for such items that do not yet have values and then plug them in. At the same time, you might want to have an onChange event to re-set the date value for a replicant if some aspect of that replicant is changed.
My understanding is that the handling of items within replicants with FormAPI is not currently "clean", but I think it can be done - and would probably do what you want.
Alternatively, you can use an "long-form"/"old-style" approach which involves post-processing via a workflow externaltask that can parse the contents of the DCR and look for these voids and set them by modifying the DCR programmatically.
Hopefully someone else here might be able to provide more information regarding the FormAPI approach.
--fish
(Interwoven Senior Technical Consultant)
manju166
I am using 5.0.1 version on WindowsNT.
I think Formapi's are available in later versions.
Thanks for your response
Manju
mogoo
Manju-
Couldn't you use your current script that keeps inserting the current date... but modify it so if the date field is already populated, don't fill it in again with the updated date?
Just a thought,
maureen
manju166
My problem is solved with <default> option
I was trying to insert the <default> option in the datacapture.cfg instead of the date.ipl file.
I was also using <substitution> instead of <default> with text area in the date.ipl script
If we use the following lines at the end of date.ipl file
print <<EOF;
<?xml version='1.0' encoding='UTF-8'?>
<substitution><default>$CurrentDateTime</default></substitution>
EOF
will solve the problem.
Maureen - thanks for your suggestion
Thankyou all for your responses. I appreciate your help!
Manju