mysql - how to display php search results in bootstrap modal? And Modal is disappearing after displaying results? -


i developing job portal users search jobs, while searches results should shown in bootstrap pop-up modal, code working modal disappearing after showing results

i tried code below

  <form action="" method="post">     <div class="input-group" id="adv-search">       <input type="text" name="term" class="form-control" placeholder="search 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">&times;</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 * job status='$status' , (  jdesc '%".$term."%' or  jtitle '%".$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> 

simply add class "in" modal class.

<div id="mymodal" class="modal fade in" role="dialog"> 

Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -