calling Modal in JAVA / Script not working in modal
Sometimes JS/ Jquery doesn't work in the modal when you call it on a button by onclick() or any other method.
i.e.==>
<a href="#" onclick="getViewFIRDetail("8165007160050","8165007160050")">8165007160050</a>
if we are displaying modal on getViewFIRDetail method/function, the jQuery script will not work properly. for work properly do it===>
$('#modalId').on('shown.bs.modal', function () {
`enter code here`
}
-----------------------------
but remember when you call modal on a button by data-target, the script will work fine,
i.e.==>
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button> -- on displaying modal by this method will work fine
i.e.==>
<a href="#" onclick="getViewFIRDetail("8165007160050","8165007160050")">8165007160050</a>
if we are displaying modal on getViewFIRDetail method/function, the jQuery script will not work properly. for work properly do it===>
$('#modalId').on('shown.bs.modal', function () {
`enter code here`
}
-----------------------------
but remember when you call modal on a button by data-target, the script will work fine,
i.e.==>
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button> -- on displaying modal by this method will work fine
Comments
Post a Comment