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. Setting Focus in textbox

Setting Focus in textbox

Scheduled Pinned Locked Moved ASP.NET
helpquestionhtmldatabase
3 Posts 2 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
    Atul Kharecha
    wrote on last edited by
    #1

    Hello, I created page to add / remove dynamic controls in HTML table. The table have some textboxes and Add button. When i click on add button, it adds new row in a table fetching value from database. The problem is, when row is added, focus should be in 1st textbox. I tried to code from client and serverside also but focus is not setting, so how can i set focus in a textbox after adding each row ? Can anyone help me please?

    M 1 Reply Last reply
    0
    • A Atul Kharecha

      Hello, I created page to add / remove dynamic controls in HTML table. The table have some textboxes and Add button. When i click on add button, it adds new row in a table fetching value from database. The problem is, when row is added, focus should be in 1st textbox. I tried to code from client and serverside also but focus is not setting, so how can i set focus in a textbox after adding each row ? Can anyone help me please?

      M Offline
      M Offline
      minhpc_bk
      wrote on last edited by
      #2

      I have no idea as to how you dynamically add the new row to the html table, but I guess that when you add the row, you can declare the id/name for the 1st textbox in the row so that you can get it later to set the focus on the textbox with the focus() method.

      A 1 Reply Last reply
      0
      • M minhpc_bk

        I have no idea as to how you dynamically add the new row to the html table, but I guess that when you add the row, you can declare the id/name for the 1st textbox in the row so that you can get it later to set the focus on the textbox with the focus() method.

        A Offline
        A Offline
        Atul Kharecha
        wrote on last edited by
        #3

        Hi minhpc_bk, Thanks for reply. I found problem after submission of this question here. The problem caused due to smartnavigation property of the page. Earlier I set smartNavigation="True", due to this, it was not working, now i removed it, its working fine. smartNavigation property causes the problems and i read somewhere that the bug solved in ASP.NET 2.

        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