Hi All,
Thanks in advance.
I trying to set a hidden field value of the DCT through the callserver CGI script BY reading a text file value. If the value in the text file contains a double quotes, the CGI is not setting the value into the DCT. I am attaching the files I am working on. Any pointers would e greatly appreciated.
Thanks!
Jenni
TS 6.5 Windows
DCT code:
[html]
<script language="javascript">
<br><br> function init()<br> {<br> IWEventRegistry.addItemHandler("/root/UserControlArea1", "onItemChange", setHiddenFieldValue);<br> }<br> <br> function setHiddenFieldValue()<br> {<br> <br> var UserControlItem1 = IWDatacapture.getItem("/root/UserControlArea1");<br> var ucaval = UserControlItem1.getOptions()[parseInt(UserControlItem1.getValue())].value;<br> var params = new Object();<br> params.ucaval = ucaval;<br> IWDatacapture.callServer("/iw-bin/setctrlval1.cgi", params, true);<br> <br> }<br> init();<br>
</script>
[/html]
CGI:
[html]
#!C:/Interwoven/TeamSite/iw-perl/bin/iwperl
use CGI;
use TeamSite::Config;
use TeamSite::CGI_lite;
### Get the location of iwhome
my $iwhome = TeamSite::Config::iwgethome();
$|=1;
my $cgi = TeamSite::CGI_lite->new();
$cgi->parse_data();
my $value = $cgi->escape_html_data($cgi->{form}{ucaval});
### Frame the file name
my $flnm = $value . ".txt";
### Open the corresponding UserControl file to read the contents
open(FILE, " $iwhome/tmp/$flnm") or die "Error: $!n";
@fldat=;
close(FILE);
my $filedata = $fldat[0];
$filedata =~ s/\"/\"/g;
### Return the value to the function in the Form API script
print <
<script language="javascript">
// Get handle to the FormAPI/userscript frame.
api = parent.getScriptFrame();
// Set the city and state.
api.IWDatacapture.getItem("/root/UCAHiddenValue1").setValue("$filedata");
</script>
EOF
### Close the script
exit;
[/html]
ProgramTitle.txt
[html]
[/html]