Zach Cochran
by Zach Cochran
~1 min read

Categories

Tags

I’ve been back working on a side project for work and I needed to get a form working inside of a modal pop up. I was able to figure out most of it this morning, getting the structure created for the modal pop up and the form, but I continue to have issues with the actual submission.

Here’s what I ended up doing to get the form inside of the modal:

<!--Modal Structure-->
<div id="user" class="modal">
  <div class="modal-content">
    <h4>Login With New User</h4>
    <div class="row">
      <form action="/login" method="POST" class="col s12">
        <div class="row modal-form-row">
          <div class="input-field col s12">
            <input id="email" type="text">
            <label for="email">Email</label>
          </div>
        </div>
        <div class="row">
          <div class="input-field col s12">
            <input id="password" type="password">
            <label for="password">Password</label>
          </div>
        </div>
      </form>
    </div>
    <div class="modal-footer">
      <button class="modal-action modal-close waves-effect waves-green btn-flat">Submit</button>
    </div>
  </div>
</div>

The problem now is that when I do the submission, express freaks out and says that it can’t find any properties of email. I’m sure there’s something obvious that I’m over looking at this point, but unfortunately I don’t have any time this morning to figure it out.

💚