title: Re-enabling a button after closing a popup window
body: <p>I have a button on a form page that opens a popup in which a user can calculate the prices of various options before submitting the form. </p>
  
  <p>However, I want the button that opens the popup to be disabled while the window is open, and enabled while it's closed. </p>
  
  <p>Disabling the button is easy: <code>calculatorButton.disabled = true;</code> works just fine inside the click event.</p>
  
  <p>What I can't work out is how to enable the button again when the popup is closed. </p>
  
  <p><code>newWindow.onunload</code> hasn't worked, nor has <code>newWindow.onbeforeunload</code>.  </p>