Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap modal not working with this template #9

Closed
topex-psy opened this issue Jun 8, 2018 · 4 comments
Closed

Bootstrap modal not working with this template #9

topex-psy opened this issue Jun 8, 2018 · 4 comments

Comments

@topex-psy
Copy link

I use a simple bootstrap modal from bootstrap 4.0 documentation, when I show the modal, modal is not visible and transparent layer will prevent me to click anywhere on the page.

This is the code of my modal:

<div class="modal fade" id="modal_komplain" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
	<div class="modal-dialog" role="document">
		<div class="modal-content">
			<div class="modal-header">
				<h5 class="modal-title" id="exampleModalLabel">Komplain</h5>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<div class="modal-body">
				<div class="text-center"><?=dom_img_spinner?></div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
				<button type="button" class="btn btn-primary">Save changes</button>
			</div>
		</div>
	</div>
</div>
@topex-psy topex-psy changed the title Bootstrap 4's modal not working with this template Bootstrap modal not working with this template Jun 8, 2018
@fathimalinsak
Copy link

Please share the HTML code of the element which triggers the modal.

@topex-psy
Copy link
Author

I just use $('#modal_komplain').modal('show');

@fathimalinsak
Copy link

please add the attributes data-toggle="modal" data-target="#modal_komplain" to the trggering element and remove the triggering through script.

Please refer http://getbootstrap.com/docs/4.1/components/modal/#live-demo for more details.

@gabryk91
Copy link

gabryk91 commented Jul 9, 2021

please add the attributes data-toggle="modal" data-target="#modal_komplain" to the trggering element and remove the triggering through script.

Please refer http://getbootstrap.com/docs/4.1/components/modal/#live-demo for more details.

I also have this problem with modal, I am used to open them from codebehind using an hidden button and a small piece of jscript, like this:

<button type="button" style="display: none;" id="btnModal" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#modalRegole">Launch demo modal</button>

<script type="text/javascript">
        function ShowModal() {
            $("#btnModal").click();
        }
    </script>

and this code behind call: ClientScript.RegisterStartupScript(Me.GetType(), "alert", "ShowModal();", True)

This works on all my other bootstrap project except the one where i'm using sb admin template.
I need to edit what the modal will show by changing its components texts and visibility and I don't know how to do this without using code behind. So I don't want to open them using attributes data-toggle and data-target

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants