Need to skip field in tab order

G

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top