访问隐藏字段值

时间:2011-10-20 20:52:07

标签: asp-classic

我正在尝试访问经典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
    %>*

1 个答案:

答案 0 :(得分:1)

当元素的名称相同时,在asp中的

,当我们执行request.form(“totalrecords”)时,你将获得逗号saperated的值。比如1,2,3,4,5所以你可以拆分并获得价值。

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

for i=0 to ubound(arr)

response.write(arr(i)) 

next