I'm working on a project for a class and I have starter code that I am editing. they way its supposed to work is that when the user creates a venue it goes to the home page with a message saying venue x has been listed. Once I add the post request in the new_venue.html it does nothing after I click the submit button nothing happens, but I know its doing something because the app.py prints the name that signed up.
Below is Code from the new_venue.html.
I added the script section and the post request
    {% extends 'layouts/main.html' %}
{% block title %}New Venue{% endblock %}
{% block content %}
  <div class="form-wrapper">
    <form id="venueInfo" method="post" class="form">
      <h3 class="form-heading">List a new venue <a href="{{ url_for('index') }}" title="Back to homepage"><i class="fa fa-home pull-right"></i></a></h3>
      <div  class="form-group">
        <label for="name">Name</label>
        {{ form.name(id='name', class_ = 'form-control', autofocus = true) }}
      </div>
      <div class="form-group">
          <label>City & State</label>
          <div class="form-inline">
            <div id='city' class="form-group">
              {{ form.city(class_ = 'form-control', placeholder='City', autofocus = true) }}
            </div>
            <div id='state' class="form-group">
              {{ form.state(class_ = 'form-control', placeholder='State', autofocus = true) }}
            </div>
          </div>
      </div>
      <div id='address' class="form-group">
        <label for="address">Address</label>
        {{ form.address(class_ = 'form-control', autofocus = true) }}
      </div>
      <div id='phone_num' class="form-group">
          <label for="phone">Phone</label>
          {{ form.phone(class_ = 'form-control', placeholder='xxx-xxx-xxxx', autofocus = true) }}
        </div>
      <div id="genres" class="form-group">
        <label for="genres">Genres</label>
        <small>Ctrl+Click to select multiple</small>
        {{ form.genres(class_ = 'form-control', autofocus = true) }}
      </div>
      <div id="fb_link" class="form-group">
          <label for="genres">Facebook Link</label>
          {{ form.facebook_link(class_ = 'form-control', placeholder='http://', autofocus = true) }}
        </div>
      <input type="submit" value="Create Venue" class="btn btn-primary btn-lg btn-block">
    </form>
    <script type="text/javascript">
      document.getElementById("venueInfo").onsubmit=function(e){
        e.preventDefault();
        fetch('/venues/create',{
        method:'POST',
        body:JSON.stringify({
          'name': document.getElementById('name').value,
          'city': document.getElementById('city').value,
          'state': document.getElementById('state').value,
          'address': document.getElementById('address').value,
          'phone_num': document.getElementById('phone_num').value,
          'genres': document.getElementById('genres').value,
          'fb_link': document.getElementById('fb_link').value,
      }),
        headers: {'Content-type': 'application/json'}
      })
      .then(function(){
      })
    }
    </script>
  </div>
{% endblock %}
below is the code from app.py
    @app.route('/venues/create', methods=['GET'])
def create_venue_form():
  form = VenueForm()
  return render_template('forms/new_venue.html', form=form)
@app.route('/venues/create', methods=['POST'])
def create_venue_submission():
  name = request.get_json()['name']
  print(name)
  flash('Venue ' + request.form['name'] + ' was successfully listed!')
  return render_template('pages/home.html')
 
     
     
    