title: smarty template getting blank after entering js validation
body: <p>pinterest js </p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  (function(d){
    var f = d.getElementsByTagName('SCRIPT')[0], p = d.createElement('SCRIPT');
    p.type = 'text/javascript';
    p.async = true;
    p.src = '//assets.pinterest.com/js/pinit.js';
    f.parentNode.insertBefore(p, f);
  }(document));
  &lt;/script&gt;
  </code></pre>
  
  <p>css files</p>
  
  <pre><code>&lt;link rel='stylesheet' href='css/fab-sales.css' media='all' type='text/css' /&gt;
  &lt;link rel='stylesheet' href='css/basic.css' media='all' type='text/css' /&gt;
  </code></pre>
  
  <p>codes</p>
  
  <pre><code>{if isset($products)}
      &lt;!-- Products list --&gt;
      &lt;ul id="product_list" class="clear"&gt;
      {foreach from=$products item=product name=products}
      {assign var=foo value=$product.link}
          &lt;li class="ajax_block_product {if $smarty.foreach.products.first}first_item{elseif $smarty.foreach.products.last}last_item{/if} {if $smarty.foreach.products.index % 2}alternate_item{else}item{/if} clearfix"&gt;
              &lt;div class="left_block"&gt;
                  {if isset($comparator_max_item) &amp;&amp; $comparator_max_item}
                      &lt;p class="compare"&gt;
                          &lt;input type="checkbox" class="comparator" id="comparator_item_{$product.id_product}" value="comparator_item_{$product.id_product}" {if isset($compareProducts) &amp;&amp; in_array($product.id_product, $compareProducts)}checked="checked"{/if} /&gt; 
                          &lt;label for="comparator_item_{$product.id_product}"&gt;{l s='Select to compare'}&lt;/label&gt;
                      &lt;/p&gt;
                  {/if}
              &lt;/div&gt;
  
  
  
  &lt;div class="center_block"&gt;
    &lt;div align="center" id="prodList"&gt;
    &lt;div class="product"&gt;
    &lt;div class="prodImgBlock filler" style="cursor:pointer"&gt;&lt;a href="{$foo|escape:'htmlall':'UTF-8'}" class="product_img_link" title="{$product.name|escape:'htmlall':'UTF-8'}"&gt;&lt;img src="{$link-&gt;getImageLink($product.link_rewrite, $product.id_image, 'home_default')}" alt="{$product.legend|escape:'htmlall':'UTF-8'}" {if isset($homeSize)} width="{$homeSize.width}" height="{$homeSize.height}"{/if} /&gt;{if isset($product.new) &amp;&amp; $product.new == 1}&lt;span class="new"&gt;{l s='New'}&lt;/span&gt;{/if}
                  &lt;/a&gt;&lt;/div&gt;
                  &lt;div class="newSocialCt"&gt;
        &lt;div class="newSocialToolBar"&gt; &lt;span style="left: 10px;" class="newSocialTool faveIt"&gt; &lt;span style="position: relative;top: 4px;display: none;" class="loader"&gt; &lt;img src="img/tmp/ajax-loader-white.gif"&gt; &lt;/span&gt;&lt;/span&gt; &lt;span class="loaderCt newSocialTool"&gt;&lt;/span&gt; &lt;span class="newSocialTool pinItTool" style="float:left; margin-left:-10px; margin-right:5px;"&gt; &lt;a href="//pinterest.com/pin/create/button/?url=http%3A%2F%2Ffab.com%2Fsale%2F21581%2Fproduct%2F147914%2F&amp;media=http://www.bluehorse.in/Administrator/images/Profile/abhishek.jpg&amp;description=Pin%20it%20on%20Pinterest" data-pin-do="buttonPin" data-pin-config="beside"&gt;&lt;img src="//assets.pinterest.com/images/pidgets/pin_it_button.png" /&gt;&lt;/a&gt; &lt;/span&gt; &lt;span class="newSocialTool" style="float:left; width:85px; margin-left:15px;"&gt;
          &lt;div id='basic-modal'&gt; &lt;a href='#' class='basic'&gt;&lt;img alt="Share" src="img/tmp/tellafriend.png" border="0" /&gt;&lt;/a&gt; &lt;/div&gt;
          &lt;/span&gt; &lt;span class="newSocialTool" style="float:none; margin-right:20px;"&gt;
        &lt;div class="fb-like" data-href="$foo" data-send="false" data-layout="button_count" data-width="450" data-show-faces="true"&gt;&lt;/div&gt;
          &lt;/span&gt; &lt;/div&gt;
      &lt;/div&gt; &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="productCt"&gt;
        &lt;div class="productDet" id="0"&gt;&lt;h4&gt;&lt;a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.name|escape:'htmlall':'UTF-8'}"&gt;{$product.name|escape:'htmlall':'UTF-8'|truncate:35:'...'}&lt;/a&gt;&lt;/h4&gt;
                  &lt;p class="product_desc"&gt;&lt;a href="{$product.link|escape:'htmlall':'UTF-8'}" title="{$product.description_short|strip_tags:'UTF-8'|truncate:360:'...'}" &gt;{$product.description_short|strip_tags:'UTF-8'|truncate:130:'...'}&lt;/a&gt;&lt;/p&gt;
              &lt;/div&gt;
      &lt;/div&gt;&lt;/div&gt;
  
  &lt;div id="push" class="clear"&gt;&lt;/div&gt;
  
  &lt;div id="basic-modal-content"&gt;
    &lt;div id="tellFriendBox"&gt;
      &lt;div class="popUpHd"&gt;
        &lt;h2&gt;Tell A Friend!&lt;/h2&gt;
      &lt;/div&gt;
      &lt;div class="error" id="tf"&gt;&lt;/div&gt;
      &lt;form class="" id="" method="post" action="" enctype="multipart/form-data"&gt;
        &lt;div class="eachRow"&gt;
          &lt;div&gt;Your Name
            &lt;label style="color:#FF0000"&gt;*&lt;/label&gt;
            :&lt;/div&gt;
          &lt;div class='field'&gt;
            &lt;input type='text' id="name" class="required email" name="name"  size='33'/&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="eachRow"&gt;
          &lt;div&gt;Friends Email Address
            &lt;label style="color:#FF0000"&gt;*&lt;/label&gt;
            :&lt;/div&gt;
          &lt;div class='field'&gt;
            &lt;input type='text' id="email_id" class="required email" name="email"  size='33'/&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="eachRow"&gt;
          &lt;div&gt;Matter:&lt;/div&gt;
          &lt;div class='field'&gt;
            &lt;textarea  rows='4' cols='25' id="matter" class="required" name="matter" &gt;&lt;/textarea&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class="eachRow"&gt;
          &lt;div class='field'&gt;
            &lt;input class="button" type='submit' name="tellafriend" onclick="return TellFriend(); "  value="Send Mail"/&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/form&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style='display:none'&gt; &lt;img src='img/tmp/x.png' alt='' /&gt; &lt;/div&gt;     
  </code></pre>
  
  <p>***after putting following javascript code for validation smarty template getting blank</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function TellFriend()
   {
    var em = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; 
    if(document.getElementById("name").value == "")
      {
        document.getElementById("tf").innerHTML=  "* Marks Fields are Mandatory ";
        document.getElementById("name").focus();
        return false;
      }
   if(document.getElementById("email_id").value == "")
      {
        document.getElementById("tf").innerHTML=  "* Marks Fields are Mandatory ";
        document.getElementById("email_id").focus();
        return false;
      }
      if (document.getElementById("email_id").value.search(em) == -1) 
      {
            document.getElementById("tf").innerHTML=  "Invalid Email "+"&lt;/span&gt;";
            document.getElementById("email_id").focus();
            return false;
       }
  
   }
  &lt;/script&gt;
  </code></pre>
  
  <p>need help..and after putting $foo as URL in pinterest..pinterest count button disappering..</p>