0
如何在java腳本中爲HiddenField設置新值。我的隱藏字段和按鈕是這樣的:在JavaScript中設置HiddenField的新值vb.net
<asp:HiddenField Id="tz" runat="server" Visible ="false"/>
<asp:Button ID="BTN_Export" runat="server" Text="Export to *.xlsx" onClientClick="SetValue();"/>
我的Java腳本:
<script type="text/javascript">
function SetValue() {
document.getElementById('tz').value = "testing !!!!!";
}
</script>
當我嘗試一語雙關一個新的價值HiddenField讓我錯誤: