Jump to content

Javasript functions not working in bootstrap modal popup window


Rommeo
 Share

Recommended Posts

I m trying to use a template, in one of the page there is a modal inserted in the code, so it works correctly if i just unzip the template and click an item ( a modal pop up window appears and all buttons work well. ) 

But I need to use the db, so that I have tried to fill the modal from an external php file, it also works, I m able to fill the fields in modal, but jquery/bootstrap buttons not working at this time.

Here is my code;

html: (where I call the model )

<a href="#" data-href="http://www.mywebsite.com/info.php?id=4" class="block2-btn flex-c-m stext-103 cl2 size-102 bg0 bor2 hov-btn1 p-lr-15 trans-04 js-show-modal1">
Check
</a>



jquery ;

$('.js-show-modal1').on('click',function(e){
e.preventDefault();
var dataURL = $(this).attr('data-href');
$('#myproinfo').load(dataURL,function(e){
$('.js-modal1').addClass('show-modal1');
});
});

$('.js-hide-modal1').on('click',function(){
$('.js-modal1').removeClass('show-modal1');
});



modal : 
<!-- content tables are  here -->
<!-- modal part here -->
<div class="wrap-modal1 js-modal1 p-t-60 p-b-20">
<div class="overlay-modal1 js-hide-modal1"></div>
<div class="container">
<div class="bg0 p-t-60 p-b-30 p-lr-15-lg how-pos3-parent">
<button class="how-pos3 hov3 trans-04 js-hide-modal1">
<img src="images/icons/icon-close.png" alt="CLOSE">
</button>
<div class="row" id="myproinfo">

<!-- DATA GOES HERE -->


</div>
</div>
</div>
</div>
<!-- jquery, bootstrap etc includes here -->

info.php;

$query = "Select * data .. etc.";
for($i=0)
echo " 
<tr>
<td><img src="'.$photo[$i].'" alt="IMG-PRODUCT"></td>
<td>'$name[$i]'</td>
<td>'$title[$i]'</td>
</tr>

How can I solve this?

Thank you in advance for your replies.

Link to comment
Share on other sites

This thread is more than a year old.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.