title: Pop-up window using php and javascript in Zend Framework
body: <p>I have a project in Zend Framework, that has on a page a menu with all products ordered by categories. I want to make a pop-up with name and description of a product. This should be shown on every click on a product. I use this code for my pop-up:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
   function show_popup(id) {
  if (document.getElementById){
      obj = document.getElementById(id);
      if (obj.style.display == "none") {
          obj.style.display = "";
      }
  }
  }
  function hide_popup(id){
  if (document.getElementById){
      obj = document.getElementById(id);
      if (obj.style.display == ""){
          obj.style.display = "none";
      }
   }
  }
  &lt;/script&gt;
  
  &lt;div id="my_popup" style="display:none;border:1px dotted gray;padding:.3em;background-color:white;position:absolute;width:400px;height:400px;left:10px;top:300px"&gt;
                                                  &lt;div align="right"&gt;
                                                          &lt;a href="javascript:hide_popup('my_popup')"&gt;Close&lt;/a&gt;
                                                  &lt;/div&gt;
                                                          &lt;h3&gt;Product Name&lt;/h3&gt;
                                                          &lt;p&gt;Product description&lt;/p&gt;
                                          &lt;/div&gt;
  </code></pre>
  
  <p>The problem is that it works with static text. My products are taken from DB like this:</p>
  
  <pre><code>&lt;?php foreach ($products as $product):?&gt;
   &lt;a href="javascript:show_popup('my_popup')"&gt; &lt;?php echo $product['front_name'];?&gt;&lt;/a&gt;
  &lt;?php endforeach;?&gt;
  </code></pre>
  
  <p>So I have a link for the pop-up on every title, but I want to print name and description of the product is clicked in that pop-up and I don't know how to verify which is the product that is clicked. I was thinking to send some parameters, but I am not sure how to do that. If you have some solutions for my problem, please do tell! Thank you</p>
  
  <pre><code>I've tried to put my **&lt;div id="my_popup&gt;**  in foreach, but it doesn't work because my pop-up windows does not appear anymore.
  </code></pre>