mozilla

Revision 408097 of Autocomplete

  • Revision slug: Code_snippets/Autocomplete
  • Revision title: Autocomplete
  • Revision id: 408097
  • Created:
  • Creator: madarche
  • Is current revision? No
  • Comment Changed title and added note to help people looking for information about HTML form inputs

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

<p>&nbsp;</p>
<h2 id="Turning_on_autocomplete" name="Turning_on_autocomplete">Turning autocomplete on for a XUL widget</h2>
<div class="note">
  <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">See also</h2>
<ul>
  <li><a href="/En/XUL/Textbox_%28Toolkit_autocomplete%29" title="https://developer.mozilla.org/En/XUL/Textbox_(Toolkit_autocomplete)">Textbox (Toolkit autocomplete)</a></li>
  <li><a href="/en/How_to_implement_custom_autocomplete_search_component" title="https://developer.mozilla.org/en/How_to_implement_custom_autocomplete_search_component">How to implement custom autocomplete search component</a></li>
</ul>
Revert to this revision