Hi,
I'm trying to put a small piece of Javascript on the Template.html page to fix a bug with the attribute output in DNN. Currently it outputs all attribute values as value1,value2,value3 etc - which is very untidy on the final page. So I managed to put together a javascript function that splits the attributes string into an array, and then outputs it back with spaces.
IN TEMPLATE.HTML
<script type="text/javascript">
var myString = '
[Attributes:Procedure Area]';
var mySplitResult = myString.split(",");
for(splitstring = 0; splitstring < mySplitResult.length; splitstring++){
document.write(mySplitResult[splitstring] + ", "); }
</script>
IN OUTPUT CODE
<script type="text/javascript">
var myString = '<span class="normal">All Countries,Asia,Europe,Latin America,Costa Rica,Malaysia,Singapore,South Korea,Taiwan,Turkey</span>';
var mySplitResult = myString.split(",");
for(splitstring = 0; splitstring < mySplitResult.length; splitstring++){
document.write(mySplitResult + ", "); }
</script>
Note: I've lost the [splitstring] in the output from DNN as it intepretes this as a tag. Is there a way of escaping this? I'm not a Javascript guru! thanks for any help.
Shah