Hi everyone. I want to make when i press a button to showup a dialog but page to not refresh or if refreshes to showup after that. i have this code but the dialog is going away after clicking the button

<form action="" method="post">
    <div class="col-xs-4 col-md-4">
    <a href="<?= $Link ?>" target="_blank" class="thumbnail">
        <img src="<?= $Image ?>" class="thumb-vote-image" alt="Item">
    <h1><button name="<?= $ID ?>" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">VOTE</button></h1>
    <h3><?= $Name ?></h3>

    if(isset($_POST[$ID])) {
        $vote = $ID;
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
    <div class="modal-dialog">

    <!-- Modal content-->
    <div class="modal-content">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal">&times;</button>
            <h4 class="modal-title"></h4>
        <div class="modal-body">
                <p>Item 1</p>
                <p>Item 2</p>
                <p>Item 3</p>
Member Avatar

Is it because you've placed the button inside a form and you have not prevented the default action (submit)?
Can't remember if buttons default to submit nor if modal js applies a preventDefault().

Oh god it worked :D i have forgoten to put type="button" in the <button> section :D
Thank you very much :)