
09-24-2009 02:36 AM
Hi,
This is SLX Web customer portal Pre 7.2 (7.01 legacy web) .
Has anybody successfully used document.write('<#PL name=xxx list="abc def">'); javascript in any of the HTML file?
For some reason it always return an error of "Unterminated string constant". and the picklist will not show.
Howeve, if I use <td><#PL name=xxx list="abc def"></td> directly in the HTML it works fine.
Also, is it possible to use a variable in placed on the list name (i.e. list=' + varname + ') ? I am having a hard time also trying to use the varname for the list name.
What I am trying to do is for the picklist to use listA if condition1 is true and use listB if not.
Any suggestions?
Thanks,
Kayono
09-24-2009 06:56 AM
Hi,
In legacy web, <# tags were serverside tags and are used when slxweb.dll is going to churn the web templates. They are supposed to generate specific HTML in that place. So 'document.write(<# PL' should generate html file with HTML something like document.write('<Select>...
So no wonder you must be getting an error.
I would suggest you see the account detail view template, where "subtype" values changes as soon as you change the "type".
hope this is helpful.
Thanks
Sandeep Gaykhe
09-24-2009 09:52 AM
Thanks for responding.
I am not trying to do a cascading picklist. What I am trying to do is to switch between the two picklists for the same field depending on the value of another field. For example if status is Active, the #PL should use the ActiveList and if status is InActive the #PL should use InactiveList for the list value. I thought I could use javascript document.write to generate the code but it doesn't work so far.
Here is the sample of the code that I have. mstatus is a global variable.
<script type="text/javascript">
<!--
if (mstatus == "T") {
document.write('<td><#PL name=ctickcustom list="Active List" options=QR ></td>');
} else {
document.write('<td><#PL name=ctickcustom list="Inactive List" options=QR ></td>');
}
-->
</script>
Any suggestions on how this can be accomplish?
09-26-2009 01:58 AM
Hi Kayono,
Well the code you are trying is mixing clientside code into serverside code and then trying to run it at client side. "mstatus" variable is clientside declared variable hence I think you should look for some workaround. May be you can have two invisible picklist created in templates and then using their content for your use. I don't remeber what property you should mention in <#PL tag to make it invisible since I had done this almost 2 yrs back, but I think you should be able to find it in Legacy web developers reference guide.
Thanks
Sandeep