文本框在页面加载后丢失值 [英] textbox loses value after page load
问题描述
我制作了asp文本框
< asp:TextBox ID = comfirmVal runat = server class = confirmElm> < / asp:TextBox >
和javascript我把条件的价值
$( 。delList)。click( function (){
if (确认(' 您确定要删除此列表吗?')){
document .getElementById( comfirmVal)。value = 1 ; // 1表示是删除
} 其他 {
document .getElementById( comfirmVal)。value = 2 ; // 2 for no
}
});
i想要在我的vb代码中检查文本框值
如果 comfirmVal.Text = value.ToString 那么
deleteList(fullPath)
结束 如果
但是comfirmVal.Text为空是在页面加载后丢失值
任何帮助?
< blockquote>( 。delList)。click( function (){
if (确认(' 您确定要删除此列表吗?')){
document .getElementById( comfirmVal)。value = 1 ; // 1表示是删除
} 其他 {
document .getElementById( comfirmVal)。value = 2 ; // 2 for no
}
});
i想要在我的vb代码中检查文本框值
如果 comfirmVal.Text = value.ToString 那么
deleteList(fullPath)
结束 如果
但是comfirmVal.Text为空是在页面加载后丢失值
任何帮助?
你必须使用document .getElementById(' <%= comfirmVal.ClientID%>')。value而不是
document .getElementById( c omfirmVal跨度>)。值
i made asp text box
<asp:TextBox ID="comfirmVal" runat="server" class="confirmElm"></asp:TextBox>
and by javascript i put value for it in condition
$(".delList").click(function () {
if (confirm('Are you sure you want to Delete This List?')) {
document.getElementById("comfirmVal").value = 1; //1 for yes delete
} else {
document.getElementById("comfirmVal").value = 2; //2 for no
}
});
i want check text box value in my vb code
If comfirmVal.Text = value.ToString Then
deleteList(fullPath)
End If
but comfirmVal.Text is empty is loses the value after page load
any help ?
(".delList").click(function () { if (confirm('Are you sure you want to Delete This List?')) { document.getElementById("comfirmVal").value = 1; //1 for yes delete } else { document.getElementById("comfirmVal").value = 2; //2 for no } });
i want check text box value in my vb code
If comfirmVal.Text = value.ToString Then deleteList(fullPath) End If
but comfirmVal.Text is empty is loses the value after page load
any help ?
Hi, you must usedocument.getElementById('<%= comfirmVal.ClientID %>').valuerather than
document.getElementById("comfirmVal").value
这篇关于文本框在页面加载后丢失值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!