i am developing a job portal where users search the jobs, while they searches the results should be shown in bootstrap pop-up modal, my code is working but modal is disappearing after immediately showing results
i tried the code as below
<form action="" method="post">
<div class="input-group" id="adv-search">
<input type="text" name="term" class="form-control" placeholder="Search for jobs" />
<div class="input-group-btn">
<div class="btn-group" role="group">
<button type="submit" name="submit" value="search" class="btn btn-primary"data-toggle="modal" data-target="#myModal">
<span class="glyphicon glyphicon-search" aria-hidden="true"></span>
</button>
</div>
</div>
</div>
</div>
</form>
<div id="myModal" class="modal fade in" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Job Results</h4>
</div>
<div class="modal-body">
<?php if($_POST['submit']=='search') {
$status='active';
$term = $_POST['term'];
$sql = "SELECT * FROM job WHERE status='$status' AND ( jdesc LIKE '%".$term."%' OR jtitle LIKE '%".$term."%' ) ";
$result = $conn->query($sql);
?>
<table class="table table-responsive table-inverse table-hover table-striped">
<thead>
<tr>
<th>JOB Title</th>
<th>DURATION</th>
<th>BUDGET</th>
<th>KEY SKILLS</th>
<th>JOINING DATE</th>
<th>EXPIRY DATE</th>
<th>EXPERIENCE MINIMUM</th>
<th>EXPERIENCE MAXIMUM</th>
</tr>
</thead>
<tbody>
<?php while ($row = $result->fetch_array()) { ?>
<tr>
<td><p><a href="/showjob?jid=<?php echo $row['jid']; ?>"><?php echo $row['jtitle']; ?></a></p></td>
<td><p><?php echo $row['duration']; ?></p></td>
<td><p><?php echo $row['budget']; ?></p></td>
<td><p><?php echo $row['keyskills']; ?></p></td>
<td><p><?php $jdate=strtotime( $row['jdate']); echo date('d/M/Y',$jdate); ?></p></td>
<td><p><?php echo $row['edate']; ?></p></td>
<td><p><?php echo $row['cdexmin']; ?></p></td>
<td><p><?php echo $row['cdexmax']; ?></p></td>
</tr>
<?php } //Endif while
} //Endif _POST ?>
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>