Date:  10/27/2004 10:07:13 AM Msg ID:  002304
From:  FoxWeb Support Thread:  002302
Subject:  Re: AAaarragh!!!
My guess is that in the second instance the content of the MergedText variable evaluates to a string containing special characters, such as quotes, which will confuse the browser.  For example, let's assume that MergedText evaluates to 'My name is "John" and I love FoxWeb'.  The final HTML content would be:
 
<A HREF="PRINTIT.FWX?mletter=My name is "John" and I love FoxWeb" TARGET="_BLANK">[Print]</A>
 
In this case the quote right before 'John' will act as the closing quote for the URL string and you will be left with garbage after that.  The right way to deal with this is to URL-encode the string:
 
<A HREF="PRINTIT.FWX?mletter=<%=Server.URLEncode(MergedText)%>" TARGET="_BLANK">[Print]</A>
 
By the way, you do not have to place the TEXTMERGE call in a separate code block.  You can simply include it directly in the URL:
 
<A HREF="PRINTIT.FWX?mletter=<%=Server.URLEncode(TEXTMERGE(M.LNOTES, .F.))%>" TARGET="_BLANK">[Print]</A>

 

FoxWeb Support Team
support@foxweb.com email

Sent by Joe Goldsmith on 10/26/2004 08:18:34 PM:
Pulling out my already falling out hair. I have the same code in two places on one FWX and it runs well in one place but not in the other. I have been working on this for two days.
 
SHIPPIT:
<%MergedText = TEXTMERGE(M.LNOTES, .F.)%>
<A HREF="PRINTIT.FWX?mletter=<%=(MergedText)%>" TARGET="_BLANK">[Print]</A>
 
DISCUSSION:
In one place I get the URL [Print] as expected and MergedText is passsed as expected. In another location on the same page, the whole text from the memo field with merged text prints in the column instead of the link.
 
CODE:
<%DO CASE%>
  <%CASE M.LETVIEW = "VCLCAASPR"%>
    <TABLE CELLSPACING=1 width=100%>
      <TR>
        <TD CLASS=PBSfields1 ALIGN="CENTER"><B>Client</B></TD>
        <TD CLASS=PBSfields1 ALIGN="CENTER"><B>Case Status</B></TD>
        <TD CLASS=PBSfields1 ALIGN="CENTER"><B>Provider</B></TD>
        <TD CLASS=PBSfields1 ALIGN="CENTER"><B>Action</B></TD>
     </TR>
     <%FOR I = 1 TO lnRecs%>
     <%GO I%>
       <TR>
         <TD CLASS=PBSfields1 VALIGN="TOP">
           <%=ALLTRIM(CLFNAME)+" "+ALLTRIM(CLLNAME)%>
         </TD>
         <TD CLASS=PBSfields1 VALIGN="TOP">
           Status#:&nbsp;<%=ALLTRIM(CASTATUS)%><BR>
           Case#:&nbsp;<%=ALLTRIM(CACASENO)%><BR>
           Intake:&nbsp;<%=DTOC(CAintdate)%><BR>
           Referred:&nbsp;<%=DTOC(CArefdate)%>
         </TD>
         <TD CLASS=PBSfields1 VALIGN="TOP">
           <%=ALLTRIM(PRFNAME)+" "+ALLTRIM(PRLNAME)%><BR>
           Status:&nbsp;<%=ALLTRIM(PRACTIVE)%><BR>
           Firm:&nbsp;<%=ALLTRIM(PRFNAME)%><BR>
           Panel:&nbsp;<%=ALLTRIM(PRPANEL)%>
         </TD>
         <TD CLASS=PBSfields1 VALIGN="TOP">
             THIS WORKS BY PLACING A LINK IN THE COLUMN
           <%MergedText = TEXTMERGE(M.LNOTES, .F.)%>
           <A HREF="PRINTIT.FWX?mletter=<%=(MergedText)%>" TARGET="_BLANK">[Print]</A>
         </TD>
      </TR>
    <%ENDFOR%>
   </TABLE>
 <%CASE M.LETVIEW = "VCLCA"%>
   <TABLE CELLSPACING=1 width=100%>
    <TR>
     <TD CLASS=PBSfields1 ALIGN="CENTER"><B>Client</B></TD>
     <TD CLASS=PBSfields1 ALIGN="CENTER"><B>Case Status</B></TD>
     <TD CLASS=PBSfields1 ALIGN="CENTER"><B>Action</B></TD>
    </TR>
     <%FOR I = 1 TO lnRecs%>
      <%GO I%>
      <TR>
       <TD CLASS=PBSfields1 VALIGN="TOP">
        <%=ALLTRIM(CLFNAME)+" "+ALLTRIM(CLLNAME)%>
       </TD>
       <TD CLASS=PBSfields1 VALIGN="TOP">
        Status#:&nbsp;<%=ALLTRIM(CASTATUS)%><BR>
        Case#:&nbsp;<%=ALLTRIM(CACASENO)%><BR>
        Intake:&nbsp;<%=DTOC(CAintdate)%><BR>
        Referred:&nbsp;<%=DTOC(CArefdate)%>
       </TD>
       <TD CLASS=PBSfields1 VALIGN="TOP">
        THIS PRINTS THE WHOLE MEMO FIELD IN THE COLUMN
        <%MergedText = TEXTMERGE(M.LNOTES, .F.)%>
        <A HREF="PRINTIT.FWX?mletter=<%=(MergedText)%>" TARGET="_BLANK">[Prints]</A>
       </TD>
      </TR>
     <%ENDFOR%>
   </TABLE>
<%ENDCASE%>
Anyone have any idea what I am doing wrong?
 
JOe