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

  1. #1

    Default still not working

    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. #38816 [Opn]: PHP code that was working perfectly recently stopped working.
      ID: 38816 User updated by: mtoohee at gmail dot com -Summary: PHP code that was working perfectly recently stopped....
    2. Macromedia Flash Player installed and working properly suddenlys stops working..
      No idea what has caused the Flash player to stop working. This is not my machine but a relatives who has asked for help over the T'giving...
    3. div tag not working
      hey guys, im having a little problem with my div tags in dreamweaver 8 ive got 4 div tags for a banner, links content and footer and each of them...
    4. Data not working on Label but is working in Datagrid
      I am creating a simple website in Flex. I want to show different content from the database for home, about us, contact us, etc. I am using a CFC as...
    5. Working TableStyle Not Working on a Second DataGrid
      I am having difficulty getting Tablestyles to work on a datagrid. I have 2 datasets, 1 filled and the other not. The first contains customer, stock...
  3. #2

    Default Re: still not working

    Hi

    var v = document.forms["FORMNAME"].FIELDNAME.value;

    Or if using getElementById.... ( document.forms... is better if supporting
    older browsers)
    document.getElementById("ELEMENTID");
    CaseSensitive... ( NOT GetElementById )

    --
    Best Regards
    Vidar Petursson
    ==============================
    Microsoft Internet Client & Controls MVP
    ==============================
    "Charles A. Lackman" <Charles@cet.com> wrote in message
    news:%23gbBZ7MQDHA.3700@tk2msftngp13.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
    >
    >
    >
    >

    Vidar Petursson Guest

  4. #3

    Default still not working

    You cannot use the ASPX name of the control.
    Instead, you need to use a modified version of the
    controls ".UniqueID" property....

    javaName = replace(txtName.UniqueID,":","_")
    and use that name in your script.

    Email if you need more.
    >-----Original Message-----
    >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
    >
    >
    >
    >
    >.
    >
    David Waz... Guest

  5. #4

    Default Re: still not working

    not 100% sure, but don't you want ClientID which unlike UniqueID, doesn't
    contain illegal javascript variable characters.

    Karl

    "David Waz..." <dlw@pickpro.com> wrote in message
    news:46ee01c34111$b07d7f90$a601280a@phx.gbl...
    > You cannot use the ASPX name of the control.
    > Instead, you need to use a modified version of the
    > controls ".UniqueID" property....
    >
    > javaName = replace(txtName.UniqueID,":","_")
    > and use that name in your script.
    >
    > Email if you need more.
    >
    > >-----Original Message-----
    > >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
    > >
    > >
    > >
    > >
    > >.
    > >

    Karl Seguin Guest

  6. #5

    Default Still not working

    I have downloaded the Microsoft Windows Script 5.6
    (Windows 2000) , but still does not work. do I need to
    import in the code design.


    sincerely yours

    Mike John



    Mike John Guest

  7. #6

    Default Re: Still not working

    Hi

    I have no idea on what you are doing... is this running in Explorer?

    var ws = new ActiveXObject("WScript.Shell");

    Security restrictions!!

    --
    Best Regards
    Vidar Petursson
    ==============================
    Microsoft Internet Client & Controls MVP
    ==============================
    "Mike John" <RiadeAsleh@hotmail.com> wrote in message
    news:87b001c34556$79a18b80$a401280a@phx.gbl...
    > I have downloaded the Microsoft Windows Script 5.6
    > (Windows 2000) , but still does not work. do I need to
    > import in the code design.
    >
    >
    > sincerely yours
    >
    > Mike John
    >
    >
    >

    Vidar Petursson Guest

  8. #7

    Default still not working

    I've tried to setup dreamweaver with contribute compatibility (remote server
    etc.) in the hope that it'll stop Contribute from hanging, but I still have
    problems with connecting to a site and in particular editing it. What else
    can I try?

    SF

    (ps see message 14-6, contribute hangs)


    SF Guest

  9. #8

    Default Re: still not working


    "SF" <sfranclGEENMAIL@wandoo.nl> schreef in bericht
    news:42cba5ad$0$66477$dbd4b001@news.wanadoo.nl...
    > I've tried to setup dreamweaver with contribute compatibility (remote
    > server etc.) in the hope that it'll stop Contribute from hanging, but I
    > still have problems with connecting to a site and in particular editing
    > it. What else can I try?
    >
    > SF
    >
    > (ps see message 14-6, contribute hangs)
    >
    >
    ps I get the following url in the adressbar:
    file:///C|/Documents%20and%20Settings/SF/Local%20Settings/Application%20Data/Macromedia/Contribute%203/Configuration/Content/ExtEdit/externaledit.htm
    or C:\Program Files\Macromedia\Contribute
    3\Configuration\Templates\Default.html

    instead of the url of the site

    SF


    SF Guest

  10. #9

    Default still not working

    the flash player is installed but now on all videos i get the little white box with the red X in it . . . please help me
    jman42 Guest

Posting Permissions

  • You may not post new threads
  • You may not 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