mercredi 22 juin 2016

How to use Bootstrap modal using the anchor tag

I have included following script an

<link rel="stylesheet" href="css/bootstrap.min.css" />
<script src="js/jquery-2.0.0.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/jquery.dataTables.js" type="text/javascript"></script>

HTML code:

<!-- Modal -->
    <div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
            <h3 id="myModalLabel">Modal header</h3>
        </div>
        <div class="modal-body">
            <p>One fine body…</p>
        </div>
        <div class="modal-footer">
            <!--<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
            <button class="btn btn-primary">Save changes</button>-->
        </div>
    </div>

My ajax call PHP page code is:

while($row = mysql_fetch_array($run_query)){
    $name = $row['first_name'];
    $name_string = "<a edit_id='name_".trim($name)."' href='#' data-target='#myModal' data-toggle='modal'>{$name}</a>";
    //onClick="click_today('{$name}');"
    $result_array[] = array($row['id'], $name_string, $row['last_name'], $row['job_title'], $row['salary']);
}

in my above php file I have passed table data into called page, here I have used for click the name and show the modal this is actually my need but modal does not show instead of it will show following output enter image description here

I don't know what is the problem I have included bootstrap 3.3.6 js and css files

pls let me know my mistake

Aucun commentaire:

Enregistrer un commentaire