Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

how prevent Bootstrap Modal from hiding automatically ?


i'm using django and HTMX on a modal that contain a form
when i click on the
"
<button type="submit" class="btn btn-primary">Submit</button>
"
it broke the modal and try to close it it doesn't close it properly

i think the problem is on plugins.bundle.js ( i'm not sure) and i couldn't ffind it

i want that when the button with type submit is clicked no thing happens
thank you by advance


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (3)


i also tried it with a simple form inside a modal and it gives the same result


<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#kt_modal_3">Launch demo modal</button>
<div class="modal fade" tabindex="-1" >
<form class="form" hx-get="/" >
<div class="modal-dialog">
<div class="modal-content position-absolute">
<div class="modal-header">
<h5 class="modal-title">Modal title</h5>

<!--begin::Close-->
<div class="btn btn-icon btn-sm btn-active-light-primary ms-2" data-bs-dismiss="modal" aria-label="Close">
<span class="svg-icon svg-icon-2x">...</span>
</div>
<!--end::Close-->
</div>

<div class="modal-body">
<p>Modal body text goes here.</p>
</div>

<div class="modal-footer">
<button type="button" class="btn btn-light" data-bs-dismiss="modal">Close</button>
<button type="submit" class="btn btn-primary">Save changes</button>
</div>
</div>
</div>
</form>
</div>



and you can add htmx in the bottom of the document with JS scripts



<script src="


thank you for your reactivity

Hi,

Could you please paste your modal code here and we will verify it? You can use https://gist.github.com/ to pass your code.

Regards.


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(