Click here to Skip to main content
15,906,341 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i made asp text box
VB
<asp:TextBox ID="comfirmVal" runat="server" class="confirmElm"></asp:TextBox>

and by javascript i put value for it in condition

JavaScript
$(".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
VB
If comfirmVal.Text = value.ToString Then
                    deleteList(fullPath)
End If



but comfirmVal.Text is empty is loses the value after page load

any help ?
Posted
Updated 4-Aug-14 10:39am
v2

1 solution

Hi, you must use
JavaScript
document.getElementById('<%= comfirmVal.ClientID %>').value
rather than
JavaScript
document.getElementById("comfirmVal").value
 
Share this answer
 
Comments
Heba Kamel 5-Aug-14 15:26pm    
the same problem

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900