title: Add Textbox value to table using jQuery for postback
body: <p>have tried searching for this with no success. I want to be able to add urls to a table from textbox values then return these to a MVC controller POST action. Have tried the below but the submit click is triggering the post back to the server rather than executing the jquery code.</p>
  
  <pre><code>&lt;h2&gt;Index&lt;/h2&gt;
  
  @using (Html.BeginForm())
  {
     &lt;input type="text" name="input" id="Text1"/&gt;
     &lt;input type="submit" value="Submit" id="submit"/&gt;
  }
  
  &lt;div class="table-responsive"&gt;
     &lt;table class="table" id="table1"&gt;
           &lt;tr&gt;
              &lt;th&gt;Site&lt;/th&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;www.example.com&lt;/td&gt;
          &lt;/tr&gt;
      &lt;/table&gt;
  &lt;/div&gt;
  
  @using (Html.BeginForm("WebDriver", "Home", FormMethod.Post))
  {
    &lt;input type="submit" value="Complete" id="complete" /&gt;
  }
  
  &lt;script type="text/javascript"&gt;
    $(document).ready(function () {
      $('#submit').click(function(){
          var val1 = $('input[id="Text1"]').val();
          for (var i = 0; i &lt; val1; i++) {
              $('table[id="table1"]')
                  .append(' &lt;tr class="row"&gt;' + val1 + '&lt;/tr&gt;');
          }
      });
  });
  &lt;/script&gt;
  </code></pre>