Javascript: Sustaining Selected Index of a ComboBox on Search
<p>I have a problem with my javascript. First of all here is my code partitions:</p>

<pre><code>&lt;select class="inputTxt" style="width: 120px;" id="yearCombo" name="yearCombo"&gt;
 &lt;option value="0"&gt;2013&lt;/option&gt;
 &lt;option value="1"&gt;2012&lt;/option&gt;
 &lt;option value="2"&gt;2011&lt;/option&gt;                
&lt;/select&gt;

function searchClicked() {
    var operationField = document.getElementById("&lt;%=FeedbackReportCtrl.PARAM_OPERATION%&gt;");
    operationField.value = "&lt;%=FeedbackReportCtrl.OPERATION_SEARCH%&gt;";  
    var yearFilter = document.getElementById("&lt;%=FeedbackReportCtrl.PARAM_YEARFILTER%&gt;");
    yearFilter.value = document.getElementById("yearCombo").options[document.getElementById("yearCombo").selectedIndex].text;
    var mainForm = document.getElementById("main"); 
    mainForm.submit();  
}
</code></pre>

<p>Here what goes wrong is the following;
For example, when I choose the year 2011 from the combo box and then hit the search button, it brings me the desired results;however, the selected index of the box returns back to 2013. How can I sustain my selection after search function?</p>
