[Fixed]-How to put a django form on a bootstrap modal with another form on the same page (outside the modal)?

1👍

Model Submit Button should be within the form tag

<div id="contact" class="modal fade" role="dialog">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Contact Me</h4>
            </div>
            <div class="modal-body">
                <form method="POST" action="/">
                    {% csrf_token %}
                    {{ contact_form|crispy }}
                    <input type="hidden" name="form-type" value="contact-form" />
                    <!--- Here --- >
                    <input type="submit" value="Send" class="btn btn-success" />
                </form>
            </div>
            <div class="modal-footer">
                <!-- The Line was here -->
                <button type="button" class="btn btn-primary" data-dismiss="modal">Close</button>
            </div>
        </div>
    </div>
</div>
👤Othman

Leave a comment