0

I am making an add button and when clicked it brings up a modal where data can be entered but when clicked, this record gets sent through and to avoid mistakes, I wish to add a confirmation(yes or no) pop up to make sure the user is certain on submitting. Has anyone worked with this before?

Heres my modal code:

<div class="modal fade" id="exampleModal" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
    <div class="modal-dialog">
      <div class="modal-content">
        <div class="modal-header">
          <h5 class="modal-title" id="exampleModalLabel">Subject add</h5>
    
        </div>
        <form action="/test/save-subject" method="POST">
            {{ csrf_field() }}
            <div class="modal-body">
          
            <div class="mb-3">
              <label for="recipient-name" class="col-form-label">Subject ID:</label>
              <input type="text" name="subjectcode" class="form-control" id="recipient-name" maxlength="6" style="text-transform:uppercase" required>
            </div>

            <div class="mb-3">
              <label for="message-text" class="col-form-label">Description:</label>
              <textarea name="detail" class="form-control" id="message-text" required></textarea>
            </div>

            <div class="mb-3">
                <label for="recipient-name" class="col-form-label">Email Address:</label>
                <input type="text" name="emailaddress" class="form-control" id="recipient-name" required>
              </div>
              <div>         
              <input type="checkbox" name="staff" value="1"> <label>Staff Update</label>
              </div>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
          <button type="submit" class="btn btn-primary">Add</button>
        </div>
    </form>
      </div>
    </div>
  </div>

0 Answers0