0
<form name = "indexSummaryForm">
<table class = "rtmindex">                                                  
    <tr>
        <td class = "rtmcolumntwo">
            <select id = "intraDayFXRateType" name = "intraDayFXRateType" class = "rtmindexselect">
                <option id = "4" selected>SPOT</option>
            </select>
        </td>
        <td class = "rtmcolumnfour">
            <input id = "preMarketOpenInterval" name = "preMarketOpenInterval" class = "rtmindexcell" type = "text" value = "0" />
        </td>
        <td class = "rtmcolumnsix">
            <select id = "intraDayFXRateBehaviour" name = "intraDayFXRateBehaviour" class = "rtmindexselect">
                <option id = "1" selected>Spot Rate</option>
                <option id = "2">Prev. Day WMSpot</option>
            </select>
        </td>
    </tr>

</table>
</form>

当我尝试提交表单时, alert("test:" + $('#indexSummaryForm').serializeArray()); 返回空值。请检查并告知代码中有什么问题?

4

2 回答 2

1

您没有ID 为 indexSummaryForm的表单

 $('[name=indexSummaryForm]') // Should work

否则,您可以将 id 添加到表单并使用id selector

于 2013-07-30T21:23:50.100 回答
1

这段代码

$('#indexSummaryForm').serializeArray())

正在请求ID ="indexSummaryForm" 的对象,您没有 ID 属性。

于 2013-07-30T21:23:53.293 回答