Computed Text & Code (Missing ; ?)

Just curious… what seems to be missing here? It is complaining about a missing operator or semicolon. This is in a computed text field and it seems to be pointing to the “checkbox” part. Hmm… this came from another site (tip for attachments). Was just going to try it out…


<input type= “checkbox” name=”%%Detach"

value=“” + Attach1 + “”><a href=“/” +

@WebDbName + “/0/” + @Text(@DocumentUniqueID)

  • “/$FILE/” + Attach1 + “?OpenElement” Target=“_new”>" +

Attach1 + “”

Subject: RE: Computed Text & Code (Missing ; ?)

So what is this?

“123” + a + “456”

Is it the string 123" + a + "456 or is it the string 123 plus the variable a plus the string 456?

It’s the latter, but suppose you meant the former, how would you write it?

A quote inside of quotes either has to be escaped with \ so the formula knows it’s not the end-quote of the string ( “123" + a + "456” ), or else you have to use different quotes around the string than you use as part of the string ( {123" + a + "456} ).

Subject: RE: Computed Text & Code (Missing ; ?)

“123” + a + “456” = the string 123 + the value of field “a” or variable “a” + the string 456. :slight_smile: I guess a link to the original solution would have been helpful. Please excuse the lack of information. Here’s the link and code…

http://searchdomino.techtarget.com/tip/0,289483,sid4_gci1244727,00.html

  1. Create a File upload file.

  2. Create a computed field to store the attachment’s file name. Name it “Attach1”.

  3. Create a hotspot button labeled “Attach” with these @formulas:

    @Command([FileSave]);

    attach:= @AttachmentNames;

    FIELD Attach1:= @Unique(Attach1 :

    attach[@Elements(attach)]);

    @Command([FileSave]);

  4. Create another hotspot button labeled “Detach” with this @formula:

    @Command([FileSave]);

  5. Create a computed text with this formulas:


    <input type= “checkbox” name=”%%Detach"

    value=“” + Attach1 + “”><a href=“/” +

    @WebDbName + “/0/” + @Text(@DocumentUniqueID)

    • “/$FILE/” + Attach1 + “?OpenElement” Target=“_new”>" +

    Attach1 + “”

Subject: RE: Computed Text & Code (Missing ; ?)

So, the formula in the tip doesn’t work; it is not syntactically correct. I suspect it’s because searchdomino has stripped all the backslash characters from the input, so the formula is not as the poster originally intended it.

So, figure out which quotes are quotes and which are data, and put the backslashes back in.

Subject: RE: Computed Text & Code (Missing ; ?)

Thanks… been trying to figure it out.