How to get the value of a textbox modified by asp.net ajax from client side(by javascript)?
I have a textbox in a asp.net update control. When I click a button on the webpage, the value of this textbox got modified. And I want to use javascript to get the modified value. The code I use was:
var kmlString = document.getElementById('<%=TextBox1.ClientID%>').getAttribute("value");
It only got the original value of my textbox. I am wondering how can I get the latest value of the textbox through javascript. T开发者_StackOverflowhe browsers I intent to use is Firefox and Safari. So it would be great if the script can work for both browsers.
Thanks very much!
Just use:
var kmlString = document.getElementById('<%=TextBox1.ClientID%>').value;
congrates! i have got the solution it was a read only field that was causing challenge remove it from source and add the attribute TextBox1.Attributes.Add("readonly", "readonly"); in page load
may god bless you!
精彩评论