title: Javascript Confirm Dialog Not Activiting
body: <p>Here is code:</p>
  
  <pre><code>&lt;form  method="post" id="cp_ind_form"&gt;
  
      // lots of input fields!
      &lt;input type="submit" name="update_submit" value="Update"  /&gt;
      &lt;input type="submit" name="delete_submit" value="Delete"  onclick="deleteConfirm()" /&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>scripts.js</strong> (confirmed that this file is connected to above page)</p>
  
  <pre><code>(function deleteConfirm() {
      var s = document.getElementById('confirm');
      s.onchange = function() {
          var yes = confirm('Do you really want to delete this location?');
          if (yes) { 
              var f = document.getElementById('cp_ind_form');
              f.submit();
          }
      }
  })();
  
  }
  </code></pre>
  
  <p>This is driving me insane.  Such a basic function is not working here?  I am basically copying it from other code that I have that DOES work, and this is no different.  Can someone confirm if I am missing a small detail?  </p>