title: Passing Value from Modal1 to another Modal2 Using Javascript ASP.NET
body: <p>How to get/pass value from Modal1 to Modal2. I have a modal1 that opens modal2 for getting value that needed in Modal1. I always get an error: "Uncaught TypeError: Cannot read property 'click' of null". I triple check my ID.</p>
  
  <pre><code>function ViewPM(field1) {
      window.top.document.getElementById("tbProjectPM").value = field1;
      document.getElementById("btnClosePM").click();
  }
  </code></pre>
  
  <p>Both window.top.document.getElementById and document.getElementById not working.</p>