471,318 Members | 1,980 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,318 software developers and data experts.

set focus

Hi,all:

I am using vb.net develop a web application. On one form(form1) I have a
button called "calculate total" and a lable call "total", after click
"calculate total", the total amount will show on the label "total", I want
set focut on the label "total" after the button "calculate total" has been
clicked.

I added code:

Dim stScript As String
stScript = "<script language=""JavaScript"">"
stScript = stScript +
"document.forms['form1'].elements['lblTotal'].focus(); </script>"
If (Not IsClientScriptBlockRegistered("SetFocus")) Then
RegisterClientScriptBlock("SetFocus", stScript)
End If

to my btnTotal_Click events and also add <onclick="btnTotal_Click"> to the
html(asp page), but not working.

I tried add same code to the page load events as well, still not working.

Any thought ?
Jul 21 '05 #1
0 997

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Nitin | last post: by
3 posts views Thread by VA | last post: by
17 posts views Thread by Neil Ginsberg | last post: by
1 post views Thread by avnrao | last post: by
11 posts views Thread by Alex.Svetos | last post: by
7 posts views Thread by Dave Booker | last post: by
3 posts views Thread by jp2express | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.