title: MVC controls not working properly without page refresh
body: <p>I've got an MVC controller that can be called via form submission in a couple different places.  The controller then renders a view whose primary purpose is to allow the user to send the document or post it to an external site, as well as fill in text fields that will be used in the notification email.</p>
  
  <p>I am performing validation on these fields - the user can enter custom subject/body text.  If they do not, they will receive a popup alert and can either return to the form or submit it using default text indicated in the placeholder value.  </p>
  
  <p>The problem is that when the user first reaches this page and clicks the send button, no input in the textboxes is actually registering and it gives the empty string notification regardless of what is actually in the fields; however, if I hit F5 and try again, the input works perfectly.  </p>
  
  <p>I feel like this has something to do with the form submissions that initially call this controller being done via POST action, whereas it seems to work fine with the GET on page refresh.  I just can't figure out how to either get the content to respond properly when the controller is called via POST, or how to submit the form without posting the data.</p>
  
  <p>Thanks in advance for reading and any help.</p>
  
  <p>Here is the calling controller:</p>
  
  <pre><code>    public ActionResult Index(FormCollection collection)
      {
          //modelbuilding code
          return View (Model);
      }
  </code></pre>
  
  <p>The code that calls the controller always uses this format: (in this case, it would be called from the Recipients/Index view.</p>
  
  <pre><code>@using(Html.BeginForm("Index", "Distribution", FormMethod.Post )) {
      //form values
      &lt;input type="submit" data-role="button" value="Done"/&gt;
  }
  </code></pre>
  
  <p>Here is the relevant part of the view and the JS validation function:</p>
  
  <pre><code>&lt;div id="SubjectTemplate"&gt;
      &lt;p&gt;Subject: &lt;input id="emailSubjectTextBox" name="EmailSubject" placeholder="@EmailSubject" /&gt;&lt;/p&gt;
  &lt;/div&gt;
  
  &lt;a href="javascript:validateInput();"&gt;Send Notification&lt;/a&gt;
  
  &lt;script&gt;               
      function validateInput() {
           var possibleErrors = [];   
           if (!(document.getElementById('emailSubjectTextBox').value)) {
                 possibleErrors.push('@incompleteEmailSubject' + '\n');
           }
           //more validation that works the same way and has the same problem
           if (possibleErrors.length &gt; 0) {
               if (confirm(possibleErrors))
               {
                 window.location.href = '@Url.Action("Send")'
               }
           }
           else {
                 window.location.href = '@Url.Action("Send")'
           }
      }                
  &lt;/script&gt;
  </code></pre>