Use Input "Id" instead of Input "Name"
<p>Hey guys I managed to get a text input and select box to updated based off of the input box using some javascript....but we changed our form variables so I can no longer use the input "name"...I now need to use the id.  How can i alter my javascript to use the id t do what Im currently doing?</p>

<p>jsp:</p>

<pre><code>TAMCN:&amp;nbsp;&lt;input type="text" id="tamcn" name="tamcn"  value=""  size="6" maxlength="5" onkeyup="javascript:tamcnSearchUpdated(this.value,'detSearchForm')" onkeypress="javascript:return noenter();" autocomplete="off" /&gt;
    &lt;select id="tamcnList"  name="filterCriteria('TAMCN').values" onchange="javascript:this.form.tamcn.value = '';"&gt;
    &lt;option value=""&gt;&amp;nbsp;&lt;/option&gt;
    &lt;c:forEach var="tamcn" items="${tamcns}"&gt;&lt;option value="${tamcn.code}"&gt;${tamcn.code}&lt;/option&gt;&lt;/c:forEach&gt;
&lt;/select&gt;
</code></pre>

<p>javascript:</p>

<pre><code>  function tamcnSearchUpdated(tamcn, formName)
    {
        var tamcnUpper = tamcn.toUpperCase();
        document.forms[formName].elements.tamcn.value = tamcnUpper;

        var len = tamcn.length;
        if ( tamcnUpper.indexOf('*') &gt;= 0 )
        {
            document.forms[formName].elements['tamcnList'].options[0].selected = 'selected';
            return;
        }

        for (var i = 0; i &lt; document.forms[formName].elements['tamcnList'].options.length; i++)
        {
            if (document.forms[formName].elements['tamcnList'].options[i].text.substr(0,len) == tamcnUpper)
            {
                document.forms[formName].elements['tamcnList'].options[i].selected = 'selected';
                return;
            }
        }
</code></pre>
