I have a tiny bit of a problem with my code, so any help will be much much appreciated!
I am using the following code as the computed text value to display multiple list of attachments in my webpage (each attachment file/entry is displayed seperatly in a new line), however, the values are seperated with a comma. I would like to hide that comma in order not to be visible to my webpage users. Is there a way to do that?
THE CODE:
attNames := @LowerCase(@AttachmentNames);
allowedExt := “.doc”:“.pdf”:“.xls”:“.ppt”:“.rar”:“.zip”;
aref := “”;
aref1 := “<a href="” + @Text(@DocumentUniqueID) + “/$file/”;
aref2 := “" target="_blank" class="links"><img border=0 hspace="4" width="18" height="18" src=…/”;
aref3 :=
“doc.gif Alt="Click here to open the Word file" title="Click here to open the Word file">”:
“pdf.gif Alt="Click here to open the PDF file" title="Click here to open the PDF file">”:
“xls.gif Alt="Click here to open the Excel worksheet" title="Click here to open the Excel worksheet">”:
“ppt.gif Alt="Click here to open the Power Point presentation" title="Click here to open the Power Point presentation">”:
“rar.gif Alt="Click here to download the Rar file" title="Click here to download the Rar file">”:
“zip.gif Alt="Click here to download the Zip file" title="Click here to download the Zip file">”;
@For(m := 1; m <= @Elements(allowedExt); m := m + 1;
ext := allowedExt[m];
@For(n := 1; n <= @Elements(attNames); n := n + 1;
newAref := @If(@Contains(attNames[n]; ext); aref1 + attNames[n] + aref2 + @Replace(ext; allowedExt; aref3) + attNames[n] + “
”; “”);
@If(newAref != “”; aref := aref : newAref; “”)));
aref := @Trim(aref);
@For(m := 1; m <= @Elements(aref); m := m + 1; aref[m]);
aref
Thanking you in advance.
P.S. I tried to display the attachments using a text field which accepts multiple values but I was unsuccessful (and personally I do not prefer this method).