Please Help With Java Script and ASPX

  • Thread starter Thread starter Charles A. Lackman
  • Start date Start date
C

Charles A. Lackman

How do I retrieve a value from an ASP.NET Textbox in Java Script.

The following code returns Null, What am I doing wrong?

var AName = document.GetElementById("txtName.Value")

Changing "Value" to "Text" also returns Null, Also, if I remove "Value"
[object] is returned.

txtName is a ASPX textbox that the visitor places their name into.

Thanks
Chuck
 
Try document.getElementById("txtName").value

Javascript is case sensitive. Also, txtName.Value isn't a name of an object.
txtName is the object - and you want to get the value of it.
 
Back
Top