问题描述:

I have a navigation bar set up on my website, I have set up a search bar towards the right of the navigation bar, see code below

 <nav class="navbar navbar-trans navbar-fixed-top" role="navigation">

<div class="container">

<div class="navbar-header">

<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapsible">

<span class="sr-only">Toggle navigation</span>

<span class="icon-bar"></span>

<span class="icon-bar"></span>

<span class="icon-bar"></span>

</button>

<a class="navbar-brand text-danger" href="index.php">Network TV</a>

</div>

<div class="navbar-collapse collapse" id="navbar-collapsible">

<ul class="nav navbar-nav navbar-left">

<li><a href="#section1">Home</a></li>

<li><a href="#section2">Top rated</a></li>

<li><a href="#section3">Most Popular by Genre</a></li>

<li><a href="#section4">Music</a></li>

<li><a href="#section5">Suggestions</a></li>

<li id="adminpanel"><a href="admin/data_display.php">Admin control panel</a></li>

<li>&nbsp;</li>

<div class="col-sm-3 col-md-3 pull-right">

<form class="navbar-form" role="search">

<div class="input-group">

<input type="text" class="form-control" placeholder="Search" name="srch-term" id="srch-term">

<div class="input-group-btn">

<button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>

</div>

</div>

</form>

</div>

</ul>

</div>

</div>

</div>

</nav>

I am wondering how do I make it so when the user types information into the search bar the results will be displayed in a bootstrap modal. for example they type 'Movies' a movies modal will pop up with name of movies in it. Here is a close up look of the search bar

 <div class="col-sm-3 col-md-3 pull-right">

<form class="navbar-form" role="search">

<div class="input-group">

<input type="text" class="form-control" placeholder="Search" name="srch-term" id="srch-term">

<div class="input-group-btn">

<button class="btn btn-default" type="submit"><i class="glyphicon glyphicon-search"></i></button>

</div>

</div>

</form>

</div>

网友答案:

This depends on how you are planning to grab the data. If I have it right, you're looking to just make a POST/GET request to some database for Movies. Looks like php, maybe Wordpress/Drupal, so guessing it'd be a MySQL request.

Here's a (free) tutorial from PHP Academy, Alex is a good tutor.

PHPAcademy Video: https://www.youtube.com/watch?v=Yb3c-HljFro

Cheers.

相关阅读:
Top