bootstrap-modal

Passing dynamic data to bootstrap modal with Laravel using jQuery post

二次信任 提交于 2019-12-04 18:49:31
I am trying to pass dynamic data to a bootstrap modal. What i want to do is pass the data-id by using jQuery post request. I have my view users containing a list with the users. when i click on details button i want to pass the id using jquery post and then using eloquent, retrieve everything about each user. my view <table class="table"> <thead class="thead-default"> <tr> <th>No.</th> <th>Name</th> <th>Actions</th> </tr> </thead> <tbody> <?php use App\User; $users = \App\User::where('admin',0)->get(); $i = 1;?> @foreach($users as $user) <tr id="{{$user->id}}"> <th scope="row">{{$i}}</th> <td

Datepicker not triggered on next page Datatable

限于喜欢 提交于 2019-12-04 16:20:33
I just want to ask how can datetimepicker be triggered on the next page of a data table? It is working correctly in the first page as seen in this screenshot. But when I go now to the next page, the calendar is not triggered anymore: Some suggested to re-initialize which I added like this: var table = $('#ot_dataTables').DataTable(); $('#ot_dataTables').on( 'page.dt', function () { $('#ot_dataTables').dataTable({ order: [[ 0, "desc" ],[ 2, "desc" ]] }); } ); But still the calendar is not showing. Any help is appreciated. Thanks a lot in advance. So this is similar to Senjuti's answer, but I

Open bootstrap modal on page load angular 2

被刻印的时光 ゝ 提交于 2019-12-04 14:05:40
问题 I am working on an angular2 project and I have 2 components namely: home and first. My home.component.html is as below :- <div class="navbar navbar-default"> <div class="container"> <div class="navbar-header"> <a href="../" class="navbar-brand">Angular 2</a> <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#navbar-main"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> </div> <div class="navbar-collapse

bootstrap modal for delete confirmation mvc

雨燕双飞 提交于 2019-12-04 11:47:43
I'm developing an MVC 5 web application. Within one of my Razor Views I have a table which spits outs several rows of data.Beside each row of data is a Delete button. When the user clicks the delete button I want to have the Bootstrap Modal popup and ask the user to confirm their deletion. add line before foreach loop @Html.Hidden("item-to-delete", "", new {@id = "item-to-delete"}) @foreach (var item in Model) { <td> <button type="" class="btn btn-sm blue deleteLead" data-target="#basic" data-toggle="modal" data-id="@item.bookid">delete</button> </td> } 2.and my modal <div class="modal fade"

How to pass data to bootstrap modal dialog in Angular2

三世轮回 提交于 2019-12-04 11:37:57
I am trying to show up a dialog in an Angular 2 application. I am using the below code for that. I am able to open up the dialog and now I need to pass the data to the dialog, how can I do that ?? I tried writting JQuery code to do that but JQuery code doesnt work for me in the angular2 application. <div class="container"> <h2>Modal Example</h2> <!-- Trigger the modal with a button --> <button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button> <!-- Modal --> <div class="modal fade" id="myModal" role="dialog"> <div class="modal-dialog"> <!--

Creating a clickable tooltip in javascript or bootstrap

北城以北 提交于 2019-12-04 10:16:09
What is the best way to make a clickable tooltip like the one in the picture below: Should I use bootstrap or some other library? Thanks. Here You go $("#Pops").popover({ html: true, content: function () { return $('#popover-content').html(); } }); [data-style=mypops] + .popover { background: #4194ca; } [data-style=mypops] + .popover.bottom .arrow:after { border-bottom-color: #4194ca; } [data-style=mypops] + .popover-content { } .popovermenu { list-style: none; padding: 0px; margin: 0px; } .popovermenu li { } .popovermenu li a { color: #fff; } <script src="https://ajax.googleapis.com/ajax/libs

Bootstrap validator for modal doesnt reset Form

£可爱£侵袭症+ 提交于 2019-12-04 10:11:56
I am using bootstrap validator for my form inside modal.The validator gets retained on subsequent form access. For example if the do the following operation Access form enter some valid value and submit the form. Access the form again the color of the field still remain in green , since i entered a valid entry in my previous form submission <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">

Google Place Autocomplete not showing in Bootstrap modal

这一生的挚爱 提交于 2019-12-04 10:08:31
问题 FIX UPDATE: It seems that the way i was initializing the box was causing issues here is what fixed it <script> $(function () { var input = document.getElementById("keyword"); var autocomplete = new google.maps.places.Autocomplete(input); $('#my-modal').modal('show'); }); </script> <style> .pac-container { z-index: 10000 !important; } </style> UPDATE: I have updated the code to be very simple, the reason this http://jsfiddle.net/g8vxmLn9/1/ works is because its using older bootstrap and jquery

Showing ajax call result in bootstrap modal

亡梦爱人 提交于 2019-12-04 09:38:20
I need to show multiple data in a Bootstrap modal. For that what I did was this: js file: $('#seeProfile').on('show', function() { $('.see-user').on('click', function(e) { e.preventDefault(); var id = $(this).data('id'); $.ajax({ url: 'getUser', type: 'POST', data: {id: id}, success: function(html){ $('#seeProfile .modal-body .p').html('test'); }, error: function(){ alert("error"); } }); }); }); view snippet (modal): <div id="seeProfile" class="modal hide fade" tabindex="-1" data-replace="true"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden=

Testing a React Modal component

こ雲淡風輕ζ 提交于 2019-12-04 07:46:30
I'm sorry, but I've been having the toughest time trying to test closing my React Modal by clicking a button. The Modal is as simple as can be, and I've tried everything I can think of or find, but I still can't query its children. The Modal component: var React = require('react'); var Modal = require('react-bootstrap').Modal; var Button = require('react-bootstrap').Button; var MyModal = React.createClass({ ... render: function() { return ( <Modal className="my-modal-class" show={this.props.show}> <Modal.Header> <Modal.Title>My Modal</Modal.Title> </Modal.Header> <Modal.Body> Hello, World! <