Why isn't this form element updating?
<p>I've got a form with an undetermined number of text inputs that I'm trying to build some auto complete functionality into. The user starts typing in 'upl_band1' and bandlookup() builds the suggestion list. When the user clicks on the li with the mouse, bandfill() is executed, and 'upl_band1' should be updated. </p>

<p>Here's the form source...</p>

<pre><code>&lt;div&gt;
    &lt;input id="upl_band1" type="text" onblur="bandhide('upl_band1');" onkeyup="bandlookup(this.value,'upl_band1');" size="25" name="upl_band1" autocomplete="off"&gt;
&lt;/div&gt;
&lt;div id="upl_band1sug" class="suggestionsBox" style="display: none;"&gt;
    &lt;img alt="upArrow" style="position: relative; top: -12px; left: 30px;" src="upArrow.png"&gt;
    &lt;div id="upl_band1auto" class="suggestionList"&gt;
        &lt;li onclick="bandfill('Cedric Gervais','upl_band1');"&gt;Cedric Gervais&lt;/li&gt;
        &lt;li onclick="bandfill('Cee-Lo Green','upl_band1');"&gt;Cee-Lo Green&lt;/li&gt;
        &lt;li onclick="bandfill('Celine Dion','upl_band1');"&gt;Celine Dion&lt;/li&gt;
        &lt;li onclick="bandfill('Celleste','upl_band1');"&gt;Celleste&lt;/li&gt;
        &lt;li onclick="bandfill('Cerrone','upl_band1');"&gt;Cerrone&lt;/li&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>And the bandfill() function. </p>

<pre><code>function bandfill(thisValue, boxName) {
    var s = boxName+"sug";
    $("#"+boxName).val(thisValue); // This is the line that isn't working.
    $("#"+s).hide();
}
</code></pre>

<p>I'm stuck on why that line isn't filling 'upl_band1' like I think it should. Help!</p>

<p><strong>Edit: I was asked to include bandhide() and bandlookup(). These work as they should.</strong></p>

<pre><code>function bandlookup(bandString, boxName) {
    if(bandString.length == 0) {
        // Hide the suggestion box.
        var s = boxName+"sug";
        $("#"+s).hide();
    } else {
        var su = boxName+"sug";
        var suauto = boxName+"auto";
        $.post("band.php", {queryString: ""+bandString+"", inputName: ""+boxName+""}, function(data){
            if(data.length &gt; 0) {
                $("#"+su).show();
                $("#"+suauto).html(data);
            }
            else if(data.length == 0) {
                $("#"+su).hide();
            }
        });
    }
} // lookup

function bandhide(boxName) {
    var s = boxName+"sug";
    $("#"+s).hide();
}
</code></pre>
