Allocate search box in default Bootstrap navbar

2

I'm having trouble allocating a search box in the bootstrap. I'm trying to allocate it in% default%, at the top right-aligned. My intention is that at each screen, I can modify the parameters for the field to work with each type of search like: product, category.

My View navbar Category

<div class="navbar navbar-header navbar-fixed-top">
<div class="container">
    <div class="navbar-collapse collapse">
        <div class="nav navbar-nav navbar-right">
            <form role="search" class="navbar-form">
                <div class="form-group has-feedback">
                    <input type="text" class="form-control" placeholder="Procurar" />
                    <span class="form-control-feedback glyphicon glyphicon-search"></span>
                </div>
            </form>
        </div>
    </div>
</div>

This way, I can not use the other "buttons" of the% bootstrap default%.

I'm using ASP .NET MVC with Bootstrap.

    
asked by anonymous 25.05.2016 / 04:02

1 answer

1

Good morning friend, I do not know if I understood your problem very well.

You want to use the buttons, including the collapse option on the left side and the search box on the right side of navbar ?

If this is the case, here is an example. I used a code snippet from the W3schools tutorials and inserted their search box into it. See:

<nav class="navbar navbar-inverse">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>                        
      </button>
      <a class="navbar-brand" href="#">WebSiteName</a>
    </div>
    <div class="collapse navbar-collapse" id="myNavbar">
      <ul class="nav navbar-nav">
        <li class="active"><a href="#">Home</a></li>
        <li class="dropdown">
          <a class="dropdown-toggle" data-toggle="dropdown" href="#">Page 1 <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a href="#">Page 1-1</a></li>
            <li><a href="#">Page 1-2</a></li>
            <li><a href="#">Page 1-3</a></li>
          </ul>
        </li>
        <li><a href="#">Page 2</a></li>
        <li><a href="#">Page 3</a></li>
      </ul>
      <ul class="nav navbar-nav navbar-right">
            <form role="search" class="navbar-form">
                <div class="form-group has-feedback">
                    <input type="text" class="form-control" placeholder="Procurar" />
                    <span class="form-control-feedback glyphicon glyphicon-search"></span>
                </div>
            </form>
      </ul>
    </div>
  </div>
</nav>

I hope I have helped. Any questions come back.

More information:

link link

    
25.05.2016 / 12:25