Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. accessing asp:textbox with javascripts

accessing asp:textbox with javascripts

Scheduled Pinned Locked Moved ASP.NET
helpannouncement
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AprNgp
    wrote on last edited by
    #1

    I want to update a asp:textbox with a javasript. Something similar to what codeproject has ... The problem is ... the textbox in my case is inside a DetailsView, which is in one of the row of a gridview. Please help me with this ...

    Apurv “Never trust a computer you can’t throw out a window.” (Steve Wozniak) “There are only two industries that refer to their customers as ‘users’.” (Edward Tufte)

    C V 2 Replies Last reply
    0
    • A AprNgp

      I want to update a asp:textbox with a javasript. Something similar to what codeproject has ... The problem is ... the textbox in my case is inside a DetailsView, which is in one of the row of a gridview. Please help me with this ...

      Apurv “Never trust a computer you can’t throw out a window.” (Steve Wozniak) “There are only two industries that refer to their customers as ‘users’.” (Edward Tufte)

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      This doesn't really matter, all that matters is that you need to write the client side names of your textboxes as javascript variables, using their clientID method on the server side, so that you're able to access them.

      Christian Graus Driven to the arms of OSX by Vista.

      1 Reply Last reply
      0
      • A AprNgp

        I want to update a asp:textbox with a javasript. Something similar to what codeproject has ... The problem is ... the textbox in my case is inside a DetailsView, which is in one of the row of a gridview. Please help me with this ...

        Apurv “Never trust a computer you can’t throw out a window.” (Steve Wozniak) “There are only two industries that refer to their customers as ‘users’.” (Edward Tufte)

        V Offline
        V Offline
        vinodkrebc
        wrote on last edited by
        #3

        You have to first run the page and then get the name of that textbox at the runtime suppose the textbox name is Ct001txt_userid then the you can get the value of text box at the run time by following var c=document.getElelmentById('Ct001txt_userid'); if(c.value=='vinod') { alert('Hi You Are Vinod') } else { alert('Hi You are not Vinod') } You can get the value of textbox by other way also var b=document.getElementById("<%=txt.ClientID%>") in the second way the name of the Control is the same what is at server end Vinod Kumar Prajapati Software Engineer EBC publishing Ltd. Lucknow(India)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups