title: Email Obfuscation in Business Catalyst
body: <p>I'm working on Businesss Catalyst Web App right now and I have a serious problem. I need to obfuscate an email field of the Web App. Unfortunately there is no easy way of doing it because all of the info from the web app item is being put on the HTML page without any pre-processing(since we dont have access to the back-end of BC).</p>
  
  <p>Here is my code right now:</p>
  
  <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Untitled Document&lt;/title&gt;
  
  &lt;script&gt;
      &lt;!--
  
      function CryptMailto()
      {
          var n = 0;
          var r = "";
          var x = document.getElementById("test");
          var s = "mailto:"+x.value;
          var e = x.value;
  
          e = e.replace( /@/, " [at] ");
          e = e.replace( /\./g, " [dot] ");
  
          for( var i=0; i &lt; s.length; i++ )
          {
              n = s.charCodeAt( i );
              if( n &gt;= 8364 )
              {
                  n = 128;
              }
              r += String.fromCharCode(n+1);
          }
  
          return "&lt;a href=\"javascript:linkTo_UnCryptMailto('"+ r +"');\"&gt;"+ e +"&lt;/a&gt;";
      }
  
      function UnCryptMailto( s )
      {
          var n = 0;
          var r = "";
          for( var i = 0; i &lt; s.length; i++)
          {
              n = s.charCodeAt( i );
              if( n &gt;= 8364 )
              {
                  n = 128;
              }
              r += String.fromCharCode( n - 1 );
          }
          return r;
      }
  
      function linkTo_UnCryptMailto( s )
      {
          location.href=UnCryptMailto( s );
      }
      // --&gt;
  &lt;/script&gt;
  
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
  
  &lt;input style = "" id = "test" type = "text" value = "test@gmail.com" /&gt;
  
  &lt;script&gt;document.write(CryptMailto());&lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Now the problem is that the hidden field can still be viewed through "View Source".</p>
  
  <p>Is there a way to pre-process a field before it gets onto the front page?</p>