user2951386
user2951386

Reputation: 261

Can't in display the pop up window on button click

I'm developing website in php using codeigniter.I need to add pop window when in click "Book now" button in my view (profile.php) following code is working perfectly in HTML Page without any problem but when i mix php tags the pop up window come and disperser quickly.this is the code that i using i can't find the problem and heed quick help,Can some one explain the error in here?

this is the code that using

<button class="btn btn-danger" id="buy-btn">BOOK NOW</button>
        <!-- Modal -->
         <div class="modal fade" id="moreInfo" tabindex="-1" role="dialog" aria-labelledby="moreInfoLabel" aria-hidden="true">
       <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
            <h4 class="modal-title" id="moreInfoLabel"><?php echo $package_data['PackageTitle']; ?></h4>
           </div>
          <div class="modal-body">
        <p>Number of Peaple :<?php echo $tour_data['Visitors']?></p>
        <p>Itenaries : Elephant Blues, Gallface, Brown Circus, Nelum Tower</p>
        <p>Method of Travel : Taxi Service</p>
        <p>Total Time Estimated : 6 Hours</p>
        <hr>
        <h4>Terms and Conditions</h4>
            <p><?php echo $tour_data['TermsAndConditions']; ?></p>
        </div>
        <div class="modal-footer">
        <button type="button" class="btn btn-primary center-block">Book Now</button>
        </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
   </div><!-- /.modal -->

Upvotes: 3

Views: 1320

Answers (1)

yalight
yalight

Reputation: 308

Try this:

<button class="btn btn-danger" id="buy-btn" onclick="$('#moreInfo').modal({show: true});">BOOK NOW</button>

Upvotes: 1

Related Questions