autocomplete structure problem
<p>I'm lost here and I really need a kind guru to help me out and to have A LOT of patience.</p>

<p>Here is, more or less, the general workflow:</p>

<ol>
<li>The user types something on a input element;</li>
<li>Onkeyup, it will grab values from our backend script, and choose one.</li>
<li>After choosing, onblur, we will grab that value and use it to query the database for some data,</li>
<li>With the data returned from the DB he will execute other commands on an external server.</li>
<li>Then it will grab that values and use them to fill some input elements that are there waiting to be filled in, once the user chooses is option from the autocomplete element.</li>
<li>With that data in place, the user can then change the values, and hit save for yet another "ajax adventure..."</li>
</ol>

<p>So, here, we are on steps 1. and 2. only: (so I believe)</p>

<p>This is what I have been able to accomplish with the help of:
<a href="http://www.nodstrum.com/2007/09/19/autocompleter/" rel="nofollow">http://www.nodstrum.com/2007/09/19/autocompleter/</a>
That I'm trying to understand and adapt.</p>

<pre><code>//1) WHEN WILL verificaInput BE CALLED?


$(document).ready(function verificaInput(inputString) {
    if (inputString.length == 0) {
        $('#sugestoes').hide();
    } else {

        $.post('modelAutocompleteTeste.php',
                  {nomeDominio: $('#nome-dominio').val()},

            function(dadosResposta){

                if(inputString.length &gt; 3) {
                    $('#sugestoes').show();

                     //2) WHAT SHOULD I PUT HERE?
                }
            },
       "json"
        );
    }
}
</code></pre>

<p>About 1.: We must NOT use inline js calls ok. Where should we call/use the events like onkeyup and onblur etc... ? About 2.:
view source
print?
    function(dadosResposta){</p>

<p>This will contain the response from our server side script, if the input string
is greater then 3, it will show our suggestions... ok...
Now, inside this suggestion I will need to populate some elements (<code>&lt;li&gt;)</code> containing ALL the data returned in json format from our server side script (it's php - using json_encode) ?
If so, is this the proper place to loop over and create the li elements?</p>

<p>More then answers, I would like to ask for some advices... I'm lost and stuck.
Please advice, other then, "leave it a alone, and go fishing that you sure are better on that".</p>

<p>MEM </p>
