2012-12-23 19 views
0

我正在使用HTML和JSP。HTML select元素未提交POSTED

我有以下形式:

<form name="test" id="test" method="get" ACTION="result.jsp"> 

<input id="enteredGene" type="text" name="enteredGene" autocomplete="off" Style="position:absolute; top: 63px; left: 295px; width: 115px; margin-top: 6px; height: 22px; right: -4px;"/><br /> 

<input type="text" id="microarrayFileName" name="microarrayFileName" Style="position:absolute; top: 209px; left: 133px; width: 275px; margin-top: 6px; height: 22px; right: 250px;" oninput="enableSubmit()"/><br /> 

<select name= "insertGenes" id="insertGenes" multiple="multiple" style="position:absolute; top: 103px; left: 138px; width: 275px; height: 71px;" onfocus="enableRemoveButton()"> 
     </select> 
</form> 

我的問題是,當我提交表單,僅是第2個標籤都貼類型「文本」的標籤。不會發布名稱爲「insertGenes」的「select」元素。我知道通過檢查獲取列表。

那隻能說明這一點:

http://localhost:8080/geneOntology/result.jsp?enteredGene=&microarrayFileName=GSM34635.pad 

爲什麼選擇元素沒有貼?我也試圖在提交後獲得它的值,我發現它是NULL。

我試圖添加其他選擇元素,它們都有相同的問題。誰能幫忙?謝謝。

回答

2

您選擇項目沒有<option> ..</option>元素

+0

但在運行時我得到JavaScript中的選項。 –

+0

是的,它在添加選項時起作用,但是如何通過在javascript中添加選項來使其工作? –

+0

看到這個線程和工作小提琴的第一個答案..http://stackoverflow.com/questions/10872714/auto-populate-select-box –