Please Help With Java Script and ASPX

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Charles A. Lackman

    Please Help With Java Script and ASPX

    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.GetEle mentById("txtNa me.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



  • Marina

    #2
    Re: Please Help With Java Script and ASPX

    Try document.getEle mentById("txtNa me").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.

    "Charles A. Lackman" <Charles@cet.co m> wrote in message
    news:urXk5PMQDH A.3020@TK2MSFTN GP10.phx.gbl...[color=blue]
    > 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.GetEle mentById("txtNa me.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
    >
    >
    >[/color]


    Comment

    Working...