title: BHO Handle OnSubmit event
body: <p>Basically I want to develop a BHO that validates certain fields on a form and auto-places disposable e-mails in the appropriate fields (more for my own knowledge). So in the DOCUMENTCOMPLETE event I have this:</p>
  
  <pre><code>for(long i = 0; i &lt; *len; i++)
  {
      VARIANT* name = new VARIANT();
      name-&gt;vt = VT_I4;
      name-&gt;intVal = i;
      VARIANT* id = new VARIANT();
      id-&gt;vt = VT_I4;
      id-&gt;intVal = 0;
      IDispatch* disp = 0;
      IHTMLFormElement* form = 0;
      HRESULT r = forms-&gt;item(*name,*id,&amp;disp);
      if(S_OK != r)
      {
          MessageBox(0,L"Failed to get form dispatch",L"",0);// debug only
          continue;
      }
      disp-&gt;QueryInterface(IID_IHTMLFormElement2,(void**)&amp;form);
      if(form == 0)
      {
          MessageBox(0,L"Failed to get form element from dispatch",L"",0);// debug only
          continue;
      }
  
      // Code to listen for onsubmit events here...         
  }
  </code></pre>
  
  <p>How would I use the IHTMLFormElement interface to listen for the onsubmit event?</p>