Looking at many forums this seems to be the solution, however, it doesn't seem to work for me:
function update() {
alert("hello world");
var test = document.getElementById("<%=InCL.ClientID%>").value;
alert(test);
}
and the asp/html is:
<asp:TextBox ID="InCL" runat="server" Text="" value="" onchange="update()"></asp:TextBox>
seems I am missing something simple? I also tried using single quotes with <%=InCL.ClientID%>
The alert "hello world" pops-up on change, but not for test...
Using asp.net 3.5, FF, master pages, etc...
Thanks.
EDIT
So I changed it to use this.value and that works, but still no solution in to how to get it by id?
works:
<asp:TextBox ID="InCL" runat="server" Text="" value="1" onchange="update(this.value)"></asp:TextBox>
with:
function update(x) {
alert(x);
}