FirmCiti Inc
FirmCiti Inc

Reputation: 407

Jquery/Ajax Modal is not loading

I am having a problem opening up my modal. I am not sure where the problem lies. rental_id is the primary key for the table in database.

<script>
    function detailsmodal(rental_id){
        var data = {"rental_id" : rental_id};
        jQuery.ajax({
            url : <?=BASEURL;?>+'includes/detailsmodal.php',
            method : "post",
            data : data,
            success: function(data){
                jQuery('body').append(data);
                jQuery('#quote').modal('toggle');
            },
            error: function(){
                alert("Something went wrong!");
            }
        });
    }
</script>

Upvotes: 0

Views: 256

Answers (2)

Karan Singh
Karan Singh

Reputation: 906

Bootstrap has a few functions that can be called manually on modals:

$('#quote').modal('toggle');//"toggle" not working sometimes
$('#quote').modal('show');
$('#quote').modal('hide');

You can see more from here: http://getbootstrap.com/javascript/#modals

Upvotes: 1

diavolic
diavolic

Reputation: 722

use

 jQuery('#quote').modal('show');

as i noticed "toggle" not working sometimes

Upvotes: 2

Related Questions