title: How to check whether (X) button in clicked in popup window
body: <p>I am trying to set the value to the hidden field in parent window from child window and want to set the value to the parent window only when popup window is closed.</p>
  
  <p>This is working fine when i use button to close the window.</p>
  
  <p>The script for the button is:
  onclick="javascript:window.close();"</p>
  
  <p>But the same condition fails when i click (X) button in title bar. Can anyone help me out with this issue</p>