2011-10-20 201 views
0

我試圖訪問經典ASP中的隱藏字段值,但無法訪問......請你幫我解決這個問題..我有點卡在這裏試圖訪問值.. ..訪問隱藏字段值

*<input type="hidden" id="totalrecords" name="totalrecords" value="1"> 
    <input type="hidden" id="totalrecords" name="totalrecords" value="2"> 
    <input type="hidden" id="totalrecords" name="totalrecords" value="3"> 
    <input type="hidden" id="totalrecords" name="totalrecords" value="4"> 
    <input type="hidden" id="totalrecords" name="totalrecords" value="5"> 
    <% 
    'trying to access it here 
    totalParts=totalrecords(0).value 
    %>* 

回答

0

在asp中當元素的名稱相同,那麼當我們做request.form(「totalrecords」)時,您將獲得以逗號分隔的值。就像1,2,3,4,5一樣,你可以拆分並獲得價值。

dim arr : arr = split(request.form("totalrecords"),", ") 

for i=0 to ubound(arr) 

response.write(arr(i)) 

next