Please Help With Java Script and ASPX

  • Thread starter Charles A. Lackman
  • 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
 
M

Marina

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top