I want a div to show only when user clicks on a button :     <form id="search" action="#" method="post" style="float: left">              
              <div id="input"  style="float: left; margin-left: 10px;" ><input type="text" name="search-terms" id="search-terms" placeholder="Search websites and categories..."  style="width: 300px;"></div>
              <div id="label"  style="float: left;margin-right: 10px;"><button type="submit" onclick="searchbox()" for="search-terms" id="search-label" class="glyphicon glyphicon-search"></button></div> 
            </form> 



when user clicks on div id "label", I want to toggle the display property of div "input". which is working fine. I have used following code to implement the functionality. 

    function searchbox(){
		if($("#input").css('display') == 'none'){ 
		$('#input').css('display','block'); 
		} else { 
		$('#input').css('display','none');
		}
	}

But  I want to to submit the form data via post. But that functionality is not working, neither by pressing enter key nor when submit button is clicked.

Please  help me with this.