<p>I'm doing some testing on Firefox toolbars for the sake of learning and I can't find out any information on how to store the contents of a "search" drop-down inside the user's profile.</p>

<p>Is there any tutorial on how to sort this out?</p>

Since it's taking quite a bit to get an answer I went and investigate it myself.
Here is what I've got now. Not all is clear to me but it works.
Let's assume you have a <textbox> like this, on your .xul:
```
```
<textbox id="search_with_history" />
```
```
You now have to add some other attributes to enable history.
```
```
<textbox id="search_with_history" type="autocomplete"
    autocompletesearch="form-history"
    autocompletesearchparam="Search-History-Name"
    ontextentered="Search_Change(param);"
    enablehistory="true"
 />
```
```
This gives you the minimum to enable a history on that textbox.
For some reason, and here is where my ignorance shows, the onTextEntered event function has to have the param to it called "param". I tried "event" and it didn't work.
But that alone will not do work by itself. One has to add some Javascript to help with the job.
```
```
// This is the interface to store the history
const HistoryObject = Components.classes["@mozilla.org/satchel/form-history;1"]
    .getService(
        Components.interfaces.nsIFormHistory2 || Components.interfaces.nsIFormHistory
    );
// The above line was broken into 4 for clearness.
// If you encounter problems please use only one line.

// This function is the one called upon the event of pressing <enter>
// on the text box
function Search_Change(event) {
    var terms = document.getElementById('search_with_history').value;
    HistoryObject.addEntry('Search-History-Name', terms);
}
```
```
This is the absolute minimum to get a history going on.