views:

51

answers:

1

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. The 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!

A: 

Just use:

var kmlString = document.getElementById('<%=TextBox1.ClientID%>').value;
Diodeus
Thanks for your reply. But it still gets the original unmodified value of the Textbox.
Aaron