+ Start a Discussion
ksmoksmo 

popup message which renders through the repeat

I have the below button on vf page.

<div id="previewButton" onclick="ShowPopup()">

Javascript on the vf page

<script>

var modal = document.getElementById('previewModal');
var btn = document.getElementById("previewButton");
var span = document.getElementsByClassName("previewclose")[0];

<!--Script for Preview Popup-->
function ShowPopup()

{
  
   modal.style.display = "block";
}



span.onclick = function() {
    modal.style.display = "none";
}

window.onclick = function(event) {
    if (event.target == modal) {
        modal.style.display = "none";
    }
}

Modal Pop up on the vf page

<div id="previewModal" class="preview">  
  <div class="previewbody ">
    <div class="previewtitleholder">
  
      <div class="previewtitle">
        TITLE
         <span class="previewclose"> &times;</span>
      </div>   
</div>
  <div class="cockpitpreviewtext"> 
  test   
  {!item.messagepreview}
  </div>

 </div>
</div>     


whne I click on the popup it should go throughthe the meesage preview field of each item record and display that message in the popup.But with this code no message appears..it is just blank.