I have been given a task to make the TextBox they tab or click to have focus. When I got it the page was using SmartNavigation="True" and the enterable TextBoxes have AutoPostBack="True" by design the focus is returned to the TextBox that had focus regardless of where you tried to tab or click to see
The AutoPostBack is needed because a label is updated for every TextBox. The user may enter a different value in the next TextBox depending on the value of the previous Label that was updated.
What I did was turn SmartNavigation="False" and put a little javascript to set a hidden field to the next TextBox with onfocus. Then when the page reloads another piece of javascript set focus to the next TextBox. This works fine if you are tabbing sequentially through the TextBoxes. It does not work when hitting shift tab (going backwards) or clicking on the third TextBox after entering data in the first TextBox.
Any ideas greatly appreciated.
Marty
The AutoPostBack is needed because a label is updated for every TextBox. The user may enter a different value in the next TextBox depending on the value of the previous Label that was updated.
What I did was turn SmartNavigation="False" and put a little javascript to set a hidden field to the next TextBox with onfocus. Then when the page reloads another piece of javascript set focus to the next TextBox. This works fine if you are tabbing sequentially through the TextBoxes. It does not work when hitting shift tab (going backwards) or clicking on the third TextBox after entering data in the first TextBox.
Any ideas greatly appreciated.
Marty