title: confirm() function is not working in Chrome & FireFox || document.depositNotifInfoForm deprecated
body: <p>In a legacy java struts application, this code in the jsp page is working fine on Internet Explorer but not working in the Chrome &amp; FireFox.</p>
  <pre><code>&lt;a id=&quot;alertSubmit&quot; class=&quot;button&quot; href=&quot;#&quot; onkeypress=&quot;&quot; onclick=&quot;javascript:this.blur();depositNotifSubmit();&quot;&gt;
  &lt;span&gt;
  &lt;bean-el:message bundle=&quot;${terms}&quot; key=&quot;label.submit&quot;/&gt;
  &lt;/span&gt;
  
  &lt;script language=&quot;javascript&quot; type=&quot;text/javascript&quot;&gt;
  
  var isSubmit = false;
  function depositNotifSubmit()
  {
    if (validateFields()) {
  if(!isSubmit){
     isSubmit = true;
     doConfirmSubmitAction(document.depositNotifInfoForm, 'depositNotifInput.recip',
  '&lt;bean-el:message bundle=&quot;${terms}&quot; key=&quot;popup.message.continue&quot; /&gt;');
      }
  }
  }
  
  function doConfirmSubmitAction(formObj, action, message)
  {
    //if (formObj == null) formObj = document.generalSubmit;
    if (action != null &amp;&amp; action != &quot;&quot;)
      formObj.action = action;
    if (confirm(message)){
   formObj.submit();
    }else{
   isSubmit = false;
    }
  } 
  </code></pre>
  <p>Expected result (working fine on Internet Explorer) :- After hitting the SUBMIT button it should prompt up a confirm box &amp;  if 'Yes' is selected, then update the changes that is written in the code not provided here.</p>
  <p>Actual result :- Working fine in Internet Explorer, showing the confirm pp-up &amp; pressed 'Yes' updating the values. But on Chrome &amp; FireFox, after hitting submit, nor confirm pop-up is showing nor the values are getting updated.</p>
  <p>Any help to get this code/scenario  working  on Chrome and Firefox would be appreciated. Find the actual screen-shots for the reference.</p>
  <p>After getting the suggestion that document.depositNotifInfoForm has been deprecated &amp; to check the browser console for the error. Attaching the screen shot of the console error for the reference.</p>
  <p>Console error :-</p>
  <pre><code>depositNotifInfo.recip:1034 Uncaught TypeError: Cannot read properties of null (reading 'value')
      at validateFields (depositNotifInfo.recip:1034:64)
      at depositNotifSubmit (depositNotifInfo.recip:980:9)
      at HTMLAnchorElement.onclick (depositNotifInfo.recip:963:147)
  validateFields @ depositNotifInfo.recip:1034
  depositNotifSubmit @ depositNotifInfo.recip:980
  onclick @ depositNotifInfo.recip:963
  </code></pre>
  <p><a href="https://i.stack.imgur.com/g3mWL.jpg" rel="nofollow noreferrer">Browser console error screen-shot</a></p>