Please Help With Java Script and ASPX

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default 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.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



    Charles A. Lackman Guest

  2. Similar Questions and Discussions

    1. CF Grid / Java Script / Action Script
      Hi, Does anyone know of a good reference for the attributes CFgrid exposes in a flash form? eg. I would like to select the first row on load. ...
    2. HELP: No POST data found from a ASPX Script HTTPWebRequest into a PHP Page
      We are working with a vendor who is trying to post some some XML data to us. They are using an ASPX script to post to a PHP page of ours. The...
    3. Mac and Java Script?
      Hello. I have an asp page with java script that calls a clicked event on some radio buttons. It works as expected except for Mac users. They are...
    4. Do you need to use Java script in ASP .Net?
      Hi, Experts, With the great functionalities in ASP .net, do we still need to use JavaScript? Thanks Jerry
    5. why doesn't this script creation, from .aspx.vb work, for this event handler???
      where szStartDate, szEndDate, szStatus, szMsgType, szClient, szFilter are all strings declared and containing data as this code executes... '...
  3. #2

    Default Re: Please Help With Java Script and ASPX

    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.

    "Charles A. Lackman" <Charles@cet.com> wrote in message
    news:urXk5PMQDHA.3020@TK2MSFTNGP10.phx.gbl...
    > 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
    >
    >
    >

    Marina Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139