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)
How to auto-populate a visual format textarea ?
John742
I am not sure what the best approach to doing this is. I would like to populate a visual format textarea item with an html like template. Pulling in a text or html file into the visual formatter. Any ideas? I have thought of using a CGI callout and also perhaps just using FormAPI's setValue. One direction would allow perl and the other javascript. Anyone ever done this?
Find more posts tagged with
Comments
jbonifaci
Well the only way you should be setting values of items within your DCT is through a setValue or the default element in your DCT, but I recommend always using setValue. That being said, setValue can be called in many ways. The question is, when do you want the item to be populated with your template?
~Jeff
John742
I would like to populate the text area -> onItemChange. I know how to change the item but my problem was how do I set the string argument for SetValue to an html file or at least the contents of the file? Thanks for the help!!
forum_example.rptdesign
jbonifaci
Hmmm, does it really make sense to do it onItemChange? So if a user goes in and makes a bunch of changes, you're going to overwrite all of those changes with the contents of some html file? Well, it's your DCT. Just do a callServer and have the callServer script read the html file and do the setValue on the item.
~Jeff
John742
sorry for the delay Thanks for the response. I am not sure I understand how to go about doing this. When you say have the call server script read the html?
jbonifaci
So you have a callServer script. It is likely a perl cgi script. In your perl cgi script, read the file using simple perl I/O. i.e. open(FILEHANDLE,
John742
ahh!! I was making this more complicated than it is. Thanks!!!