title: Blazor do logic before submitting form data
body: <p>In my Blazor Server-Side App, I have to call another website and submit a form.  However, before the form can be submitted the app needs to do some local processing and based on the result submit the form or do not.  How is this done?</p>
  <p>My thought was to have a button that has <code>@onclick</code> and from that function call the form.  Something like this:</p>
  <pre><code>&lt;button @onclick=&quot;MyFunction&quot;&gt;Click Me&lt;/button&gt;
  &lt;form METHOD=&quot;POST&quot; ACTION=&quot;https://someURL.com&quot;&gt;
      &lt;input TYPE=&quot;hidden&quot; NAME=&quot;value1&quot; VALUE=&quot;@myValue1&quot;&gt;
      &lt;input TYPE=&quot;hidden&quot; NAME=&quot;value2&quot; VALUE=&quot;@myValue2&quot;&gt;
      &lt;input TYPE=&quot;SUBMIT&quot; NAME=&quot;SUBMIT&quot; class=&quot;btn btn-primary&quot; style=&quot;margin: 5px&quot; VALUE=&quot;Do stuff&quot;&gt;
  &lt;/form&gt;
  @code{
      private void MyFunction()
      {
          if (AmazingLogicFunction())
           //Code to click SUBMIT
      }
  }
  </code></pre>
  <p>However, I cannot seem to be able to get the <code>element</code> named <code>SUBMIT</code></p>
  <p>If I have to do it some other way I am fine with that.</p>