django-bootstrap-modal-forms icon indicating copy to clipboard operation
django-bootstrap-modal-forms copied to clipboard

Open a new modal with the current modal form's results

Open Sorath93 opened this issue 1 year ago • 0 comments
trafficstars

It seems that there is no support for the Submit button in the form's modal to also use the Bootstrap5 attributes like data-bs-target.

I.e. I want to be able to toggle between modals (https://getbootstrap.com/docs/5.3/components/modal/#toggle-between-modals) but also have form validation occur due to "type='submit'" being set on the button.

For example, in my project I currently have a button like this: <button type="submit" class="btn btn-primary">Generate</button>

I want this button to open a new modal with the results being displayed, therefore, I tried this:

<button type="submit" class="btn btn-primary" data-bs-target="#exampleModalToggle2" data-bs-toggle="modal">Generate</button>

However, if the form is invalid then exampleModalToggle2 still loads after I VERY breifly see the front-end error messages (the ones with the yellow "!" icon).

My view inherits from BSModalFormView and the form inherits form BSModalForm

Sorath93 avatar Jan 10 '24 14:01 Sorath93