2011-06-08 43 views
0

如何通過HTML發送隱藏的輸入值。我寧願不用JavaScript這樣做,因爲我不太瞭解它,但如果這是唯一的方式,你會如何使用JavaScript發佈它?我可以傳遞這些值,並通過QueryString得到它們,但我不喜歡。按字母順序分頁經典ASP vbscript

代碼:

alphaChar = request.Form("alpha") 
if alphaChar <>"" then 
    Response.Write alphaChar 
    response.Write("Test") 
end if 


       <a href="<%=obj_Session.str_FileName%>">#</a> 
       <% for i = 97 to 122 %> <a href="<%=obj_Content.GetContent("PageName")%>"> 
       <input type="hidden" name="alpha" value="<%=CHR(i)%>"> 
       <%=CHR(i)%></a>&nbsp;<% 
       next 
       %> 

回答

0

找到一個解決方案,其中我可以使用交超鏈接。我使用css將按鈕設置爲超鏈接並通過發佈發送值。下面的代碼。

<form action="Table.asp" method="post" name="form2"> 
<input type="submit" name="Button" value="#" style="background:transparent;border:0;display:inline;color:#00F;text-decoration:underline;padding:0px"> 
<% for i = 97 to 122 %> 

    <input type="submit" name="Button" value="<%=CHR(i) %>" style="background:transparent;border:0;display:inline;color:#00F;text-decoration:underline;padding:0px">&nbsp; 
    <% next %> 

</br></br></br> 

<% 
    alphaB = request.form("Button") 
if alphaB <>"" then 
     response.write alphaB 
end if 

%> 
0
你在服務器端使用的Request.Form

。這是必須的嗎?

alternativley你可以使用鏈接並在你的asp頁面上做一個href TEST.ASP?炭= A或TEST.ASP?炭=#

然後在serverdside使用的Request.QueryString( 「焦炭」)

+0

我已經知道如何通過查詢字符串,但即時通訊尋找一種方法來傳遞它通過post方法,如果可能的話,即使我只能用javascript – 2011-06-08 12:16:43