0

What I want to do i fairly simple and I apologize if it has been asked before but this is for a project due in a few days and I have been stuck on this very simple problem.

I have a forum component I am using from bootstrap and a link button. What I want to do is append a link with the user's input so their input will be sent to my python server and re render the page. ege "/bars/12345"

It works if I hard code in values to the URL in the href ege "12345" , but I am not able to extract user input from the forum I have used. Below is my code, many thanks!

<div class= "container">
  <form id="login-form">
    <div class="form-group">
      <label for="bSearch">Search for Bar</label>
      <input type="string" class="form-control" id="barSearch" aria-describedby="barHelp" placeholder="Enter number here ">
      <small id="barHelp" class="form-text text-muted">Search for a bar by license #</small>
      </div>
    <a class="btn btn-primary" href="/bars/$('#login-form')[0].serialize()" role="button">Link</a>
  </form>
</div>

  <div class="jumbotron jumbotron-fluid">
      <div class="container">
          <h1 class="display-4">{{ barName }}</h1>
          <p class="bar-details" *ngIf="barDetails">
              {{ barDetails?.city }} <span *ngIf="barDetails.city && barDetails.license">|</span> {{ barDetails?.license }}
              <br>
              <span>License # </span> {{ barDetails?.license }} 
          </p>
      </div>
  </div>
RichardFeynman
  • 478
  • 1
  • 6
  • 16
  • Possible duplicate of [Adding Select Field to Bootstrap Form and Getting it to Post to Database in Laravel Project](https://stackoverflow.com/questions/35607674/adding-select-field-to-bootstrap-form-and-getting-it-to-post-to-database-in-lara) – Tedinoz Nov 16 '18 at 00:02
  • why not just use ngSubmit and just pass the data to the function that will submit the form ? – svarog Nov 17 '18 at 10:11

0 Answers0