Topic: why no <form> tag in modal forms?

Chris Canning free asked 5 years ago


expected to add needs-validation to form tag

*there is no form tag *

**https://mdbootstrap.com/docs/jquery/forms/validation/ is the suggested way to implement form field validation but I'm using a modal form and here is the html of it... Request Appointment (Not indication of availability)

×

                  <div class="modal-body mx-3">

                    <div class="md-form mb-5">
                      <i class="fas fa-user prefix grey-text"></i>
                      <input type="text" id="name" class="form-control validate">
                      <label data-error="wrong" data-success="right" for="name">Your name</label>
                    </div>

                    <div class="md-form mb-5">
                      <i class="fas fa-envelope prefix grey-text"></i>
                      <input type="email" id="email" class="form-control validate">
                      <label data-error="wrong" data-success="right" for="email">Your email</label>
                    </div>

                    <div class="md-form mb-5">
                      <i class="fas fa-calendar-day prefix grey-text"></i>
                      <!-- <input type="text" id="form32" class="form-control validate"> -->
                      <input type="date" id="date" class="form-control validate" name="date">
                      <label data-error="wrong" data-success="right" for="date">Date</label>
                    </div>

                    <div class="md-form mb-5">
                      <i class="fas fa-clock prefix grey-text"></i>
                      <input type="time" id="time" class="form-control validate">
                      <label data-error="wrong" data-success="right" for="time">Time</label>
                    </div>

                    <div class="md-form">
                      <i class="fas fa-pencil prefix grey-text"></i>
                      <textarea type="text" id="form8" class="md-textarea form-control" rows="4"></textarea>
                      <label data-error="wrong" data-success="right" for="form8">Your message</label>
                    </div>

                  </div>
                  <div class="modal-footer d-flex justify-content-center">
                    <button class="btn btn-unique">Send <i class="fas fa-paper-plane-o ml-1"></i></button>
                  </div>
                </div>
              </div>
            </div> **


There's no reason to not to use the form tag - I'll add this to our TODO list so our docs will be updated



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: General Bootstrap questions
  • MDB Version: -
  • Device: mbp
  • Browser: chrome
  • OS: mac high sierra
  • Provided sample code: No
  • Provided link: Yes