Note that there are some explanatory texts on larger screens.

plurals
  1. POshow dropdown menu on click
    primarykey
    data
    text
    <p>I have my drop down menu css like this </p> <pre><code>&lt;style type="text/css" media="screen"&gt; /*body { font-family: Arial, Verdana, sans-serif; font-size: 14px; }*/ .ui-autocomplete { padding: 0; list-style: none; background-color: #fff; width: 218px; border: 1px solid #B0BECA; max-height: 250px; overflow-y:hidden; } .ui-autocomplete .ui-menu-item a { border-top: 1px solid #B0BECA; display: block; padding: 4px 6px; color: #353D44; cursor: pointer; } .ui-autocomplete .ui-menu-item:first-child a { border-top: none; } .ui-autocomplete .ui-menu-item a.ui-state-hover { background-color: #D5E5F4; color: #161A1C; } &lt;/style&gt; </code></pre> <p>It is been linked to a text box.I would like to show my drop down menu when a user clicks on the text box for the first time. </p> <p>I tried to write this function on javascript</p> <pre><code>function showsuggestion(){ $('.ui-autocomplete').show(); } </code></pre> <p>which is fired when the "onfocus" event ocur on the text box</p> <p>HTML Structure - </p> <pre><code>&lt;div class="left searchtop myCorner1 searchtopinside" id="suggestionbox"&gt; &lt;form method="get" action="{% url simplesearch %}" name="searchform" onsubmit="return search('searchform',this);"&gt; &lt;ul&gt; &lt;li&gt;&lt;strong&gt;Search&lt;/strong&gt;&lt;/li&gt; &lt;li&gt;&lt;select name="q" id="id_q" autocorrect="off" autocomplete="off" style="width:260px;" onfocus="hide_msg('autosuggest','Enter Institute or Course Name'); showsuggestion();" onblur="show_msg(this,'Enter Institute or Course Name' )" onkeyup="javascript:keyup({{lenletters}})"&gt; &lt;li&gt;&lt;input type="text" class="text2" value="Enter Location" name="location" id="id_location" onfocus="hide_msg('id_location','Enter Location')" onblur="show_msg(this,'Enter Location' )" /&gt;&lt;/li&gt; &lt;!--&lt;li class='enter_loc'&gt;&lt;input type="text" class="text2" value="Enter Location" name="location" id="id_autocomplete" onfocus="shows_div();set_css();set_css1();set_css2();" onkeyup="div_autocomplete()" /&gt;&lt;/li&gt; {% include 'widgets/city_state_widget.html' %} --&gt; &lt;li&gt;&lt;input type="submit" class="button_new_big " value="Search" onclick="event_tracking()"/&gt;&lt;div class="button_big_Ending"&gt;&lt;/div&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/form&gt; &lt;/div&gt; </code></pre>
    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.
    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