Add the button next to the search bar inside the Bootstrap header

advertisements

I have created a responsive Bootstrap header having Name in the left corner, search bar and dropdown list in the right hand corner. Now I'm trying to add a button on the left hand side of the searchbar but not being able to..

Js fiddle https://jsfiddle.net/Lucy1/qn0r10th/4/

HTML code..

     <nav class="navbar navbar-default navbar-fixed-top" id="header">
        <div class="container-fluid">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar1">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a href="index.html" class="navbar-brand" id="icon"><b>Sample Name</b></a>
            </div>
            <div class="collapse navbar-collapse" id="myNavbar1">

                <ul class="nav navbar-nav navbar-right" id="navbar1right">
                    <li class="dropdown" id="subheader">
                         <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Dropdown <span class="caret"></span></a>
                        <ul class="dropdown-menu" id="dropA">
                         <li><a href="#">Action</a></li>
                        </ul>
                    </li>
                </ul>

                <form class="navbar-form navbar-right" role="search" id="navBarSearchForm" type=get action="myindex.html">
      <div class="input-group" id ="searchA">
      <button onclick="storeYourStuff()" id="button_top_right" class="btn btn-primary">StoreYourStuff</button>
                    <input id="wish_title1" type="text" class="form-control" placeholder="Search Website" name="wish_title1"></input>
                            <span class="input-group-btn">
                                <button class="btn btn-primary"><i class="glyphicon glyphicon-search"></i></button>
                            </span>
                </div>

                </form>
            </div>
        </div>
    </nav>

I'm trying to add a button before the searchbar inside the form tag but not able to. Can't figure out where I'm going wrong.. Please help


The button should be placed inside a proper span

<form class="navbar-form navbar-right" role="search" id="navBarSearchForm" type=get action="myindex.html">
      <div class="input-group" id ="searchA">
      <span class="input-group-btn"><button onclick="storeYourStuff()" id="button_top_right" class="btn btn-primary">StoreYourStuff</button></span>

                    <input id="wish_title1" type="text" class="form-control" placeholder="Search Website" name="wish_title1">
                            <span class="input-group-btn">
                                <button class="btn btn-primary"><i class="glyphicon glyphicon-search"></i></button>
                            </span>
                </div>
                </form>