Ask a Question related to ASP.NET General, Design and Development.
-
Deidre #1
Set focus problem
I have a page with a drop down and several web controls. The drop down
is set to postback and it reloads the textboxes based on the selected
drop down item. I set the focus to the first textbox control on the
client like this:
<script language="vbscript">
Option Explicit
....other code
If Not <%=mbReadOnly%> Then
document.frmDetails.txtName.focus()
End If
....other code
</script>
This works fine on first page load but when I change the drop down it
does reset the focus and you can't even type in the first textbox
until you select another textbox first.
To debug I added a message box right before the set focus to see if it
was even getting to this line of code and it works but I can't leave a
message box here.
Any ideas on what could be the problem?
Thanks in advance for any help,
Deidre
Deidre Guest
-
Focus problem w/player 8.5 & 9
I'm using flash 8, and it's regular html deployment methond (code). Ever since I got player 8.5 and now 9 I have to click once on my movie to bring... -
ComboBox Focus Problem
Hello All, I've been playing around with populating a ComboBox with a list of the fonts on the user's machine and allowing the user to apply one... -
Combo Box Focus Problem
I need some help. I have a combo box set so you can edit the fields. I want the focus to be initially in the text field in the combo box. This is... -
Popup; show, take focus, wait for button action, give focus, hide
Hi. I've got a popup MC for displaying a message or asking a yes/no question that has to do the following on an event: - show and take focus... -
Focus problem
hi there.... it seems that when we change an html with swf in side in the same frame (html) the mouse lose his focus until you click it or move... -
Ravikanth[MVP] #2
Set focus problem
Hi
setfocus in body onload event,
document.frmDetails.txtName.focus()
HTH
Ravikanth
The drop down>-----Original Message-----
>I have a page with a drop down and several web controls.the selected>is set to postback and it reloads the textboxes based oncontrol on the>drop down item. I set the focus to the first textboxdrop down it>client like this:
><script language="vbscript">
>Option Explicit
>....other code
>If Not <%=mbReadOnly%> Then
>document.frmDetails.txtName.focus()
>End If
>....other code
></script>
>This works fine on first page load but when I change thefirst textbox>does reset the focus and you can't even type in thefocus to see if it>until you select another textbox first.
>To debug I added a message box right before the setcan't leave a>was even getting to this line of code and it works but I>message box here.
>Any ideas on what could be the problem?
>Thanks in advance for any help,
>Deidre
>.
>Ravikanth[MVP] Guest
-
Deidre #3
Re: Set focus problem
Thanks for the suggestion but it does the same thing if I put it in a
body onload event.
"Ravikanth[MVP]" <dvravikanth@hotmail.com> wrote in message news:<0e1c01c34d31$17c134a0$a301280a@phx.gbl>...> Hi
>
> setfocus in body onload event,
>
> document.frmDetails.txtName.focus()
>
> HTH
> RavikanthDeidre Guest
-
Deidre #4
Re: Set focus problem
I fixed my problem. I needed to move my set focus command to the window_onload sub:
Sub Window_OnLoad()
If Not <%=mbReadOnly%> Then
document.frmDetails.txtName.focus()
End If
End Sub
Deidre
Deidre Guest



Reply With Quote

