mozilla

Revision 504047 of Autocomplete

  • Revision slug: Mozilla/Add-ons/Code_snippets/Autocomplete
  • Revision title: Autocomplete
  • Revision id: 504047
  • Created:
  • Creator: wbamberg
  • Is current revision? No
  • Comment Code_snippets/Autocomplete Mozilla/Add-ons/Code_snippets/Autocomplete

Revision Content

Turning autocomplete on for a XUL widget

This article is about XUL widgets and not about HTML form inputs.

First, declare a panel with the "autocomplete" type, like so:

<panel id="popup_autocomplete" type="autocomplete" noautofocus="true" />

Now set the autocompletepopup attribute of your <browser> element to the id of the panel you just declared:

<browser id="my_browser" ... autocompletepopup="popup_autocomplete" />

Finally, make sure that the value of the browser.formfill.enable pref is set to true.

See also

Revision Source

<h2 id="Turning_on_autocomplete" name="Turning_on_autocomplete">Turning autocomplete on for a XUL widget</h2>
<div class="warning">
  <p>This article is about XUL widgets and not about HTML form inputs.</p>
</div>
<p>First, declare a panel with the "autocomplete" type, like so:</p>

<pre>
&lt;panel id="popup_autocomplete" type="autocomplete" noautofocus="true" /&gt;
</pre>
<p>Now set the autocompletepopup attribute of your &lt;browser&gt; element to the id of the panel you just declared:</p>

<pre>
&lt;browser id="my_browser" ... autocompletepopup="popup_autocomplete" /&gt;
</pre>

<p>Finally, make sure that the value of the browser.formfill.enable pref is set to true.</p>

<h2 id="See_also" name="See_also">See also</h2>
<ul>
  <li><a href="/en-US/docs/XUL/Textbox_%28Toolkit_autocomplete%29">Textbox (Toolkit autocomplete)</a></li>
  <li><a href="/en-US/docs/How_to_implement_custom_autocomplete_search_component">How to implement custom autocomplete search component</a></li>
</ul>
Revert to this revision