Note that there are some explanatory texts on larger screens.

plurals
  1. POAttach div to a search textbox to create Gmail like search box
    primarykey
    data
    text
    <p>I am creating a Gmail like search box where I click on the text box and it opens a new div where I can enter search criteria for various fields. How can I tightly attach the TextBox('#searchTextBox) or the div containing the textbox with the div for search form ('#gmailSearchBox)? Also I am using bootstrap responsive and thus the location and size of the text box changes. So just setting div style display:block and display:none doesnt work. Thanks.</p> <p>Html Code:</p> <pre><code>&lt;div style="border:1px solid grey; border-radius:3px; max-width:300px; padding-right:0px; padding-left:0px;"class="container-fluid"&gt; &lt;div style="left:0px;right:20px; line-height:inherit; float:left; width:100%; "&gt; &lt;input id="searchTextBox" type="text" style="border:none; width:95%; line-height:inherit; padding:0px 0px 0px 0px;"&gt; &lt;a id="showSearchBox" href="#" style="height:20px"&gt; &lt;span class="caret" style="vertical-align:middle; height:100%"&gt; &lt;/span&gt; &lt;/a&gt; &lt;/input&gt; &lt;/div&gt; &lt;/div&gt; &lt;input type="button" value="Search" Class="btn btn-primary" /&gt;&lt;br&gt; Various&lt;br&gt; Other&lt;br&gt; Information&lt;br&gt; Goes &lt;br&gt; Here&lt;br&gt; &lt;div id='gmailSearchBox' class="gmailSearchBox" style="position:absolute; display:none; border:1px solid grey"&gt; &lt;form action="" method="post"&gt; From:&lt;input type="text" id="fromDate"&gt; &lt;br/&gt; To: &lt;input type="text" id="toDate"&gt; &lt;br/&gt; Type:&lt;select id="logType"&gt; &lt;option&gt;--Select Type--&lt;/option&gt; &lt;/select&gt; &lt;br/&gt; Text:&lt;input type="text" id="searchText"&gt; &lt;br/&gt; &lt;input type="submit" class="btn btn-primary"&gt; &lt;/form&gt; &lt;/div&gt; </code></pre> <p>Javascript Code</p> <pre><code>$('#showSearchBox').click(showSearchBox); function showSearchBox() { $('#gmailSearchBox').css('display','block') } </code></pre> <p>JsFiddle link - <a href="http://jsfiddle.net/7FBax/" rel="nofollow">http://jsfiddle.net/7FBax/</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload