G
Guest
I'm trying to set focus to a control when the page is loaded. The control may be different from one entry to the next so I cannot just hardcode it into the <body onload..>. I've tried several variations using registerstartupscript, and I see the script before the <\form>, but it doesn't seem to fire. Here's my current code which is called in the page_load
Private Sub SetFocus(ByVal ttctrl As System.Web.UI.Control
Dim s As String
s = "<SCRIPT language=""javascript"">document.forms[0].item('" & ttctrl.ID & "').focus(); <SCRIPT>
RegisterStartupScript("setFocus", s
End Su
this is what appears in my html
<SCRIPT language="javascript">document.forms[0].item('txtStmtMnth').focus(); <SCRIPT
What am I doing wrong
Thank
Private Sub SetFocus(ByVal ttctrl As System.Web.UI.Control
Dim s As String
s = "<SCRIPT language=""javascript"">document.forms[0].item('" & ttctrl.ID & "').focus(); <SCRIPT>
RegisterStartupScript("setFocus", s
End Su
this is what appears in my html
<SCRIPT language="javascript">document.forms[0].item('txtStmtMnth').focus(); <SCRIPT
What am I doing wrong
Thank