Question: I am setting up a navbar that contains a button that is expected to submit the form in the body (album\_form). Any suggestions on what to put in for the onclick to accomplish this?

```
<body>
  <header>
    <navbar>
      <button type="submit" name="save_album" class="btn" id="save_album" onclick="????" value="Save Album">Save Album</button>
    </navbar>
  </header>
  <main>
    <form action="/album/" method="POST" name="album_form" id="album_form">
     <input />
    </form>
  </main>
</body>

```

Answer: 
You dont need anything in the onclick. Just add this javascript.

```
document.getElementById("save_album").addEventListener("click", function() {
  document.getElementById("album_form").submit();
});

```

DEMO <https://jsfiddle.net/4xcmh2ms/6/>
You can try following way:

```
<button type="submit" name="save_album" class="btn" id="save_album"     onclick="document.getElementById('album_form').submit()" value="Save Album">Save Album</button>

```