We use a set focus function that we've built into a utility class. Then the
webform calls the function. If I have a textbox named txtClient to which I
want to set the focus, I would call the function as follows:
Utilities.sbSetFocus(Me.txtClient, Page)
Here is the function:
Public Shared Sub sbSetFocus(ByVal FocusControl As Control, ByRef pgPage As
System.Web.UI.Page)
Dim Script As New System.Text.StringBuilder
Dim ClientID As String = FocusControl.ClientID
With Script
.Append("<script language='javascript'>")
.Append("document.getElementById('")
.Append(ClientID)
.Append("').focus();")
.Append("</script>")
End With
pgPage.RegisterStartupScript("setFocus", Script.ToString())
End Sub
"Bill Borg" wrote:
Hello,
I would like to skip over a hyperlink in the tab order. The link is not that
important, and I don't mind that they have to click to get it.
I have tried OnFocus="this.blur();" on the link, which works, but the focus
does not move to the *next* field (per the docs it's indeterminate where
blur() sends the focus, likely up to the window, which is what happens in IE).
What I think I want is the equivalent of OnFocus=NextField.focus(), but I
can't figure out the syntax of getting NextField (i.e. [this+1]).
Thanks,
Bill