show modal with jquery code example

Example 1: onclick open modal jquery

$('#myModal').modal('toggle');
$('#myModal').modal('show');
$('#myModal').modal('hide');

Example 2: jquery on modal show

$(window).on('shown.bs.modal', function() { 
    $('#code').modal('show');
    alert('shown');
});

Example 3: modal show jquery event

<div class="modal fade" id="phoneEdit" tabindex="-1" role="dialog" aria-labelledby="phoneEdit" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header center">
        
            <label class="large-text bold text-align-left"> 
              <?= __d('member', 'edit_password'); ?>
            </label>

        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
    
      <div class="modal-body">
	  </div>
     </div>
  </div>
</div>



$("#phoneEdit").on('shown.bs.modal', function(e){
        console.log('enter here');
     
     	// do anything after the modal open
        $(".number_six").val("");
    });

Example 4: jquery dialog modal on modal

.ui-dialog { z-index: 1100 !important ;}

Example 5: how to make popup modal in jquery with example

<!-- AJAX response must be wrapped in the modal's root class. -->
<div class="modal">
  <p>Second AJAX Example!</p>
</div>

Example 6: onclick open modal jquery

$('#my-modal').modal({
    show: 'false'
});

Tags:

Html Example