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