Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Window OnLoad and check for IsObject

Status
Not open for further replies.

MaeJams

Programmer
Apr 24, 2001
51
US
I've tried putting some client code in the OnLoad event handler of the Window object that checks for an input object. If it finds it, the page is supposed to set the focus to that input object. I thought this event was supposed to fire when the window finishes loading the page, but it doesn't seem to work.

The code looks something like this:

Sub Window_OnLoad()
If IsObject(Input_Two) Then
Document.all.Input_Two.focus
End If
End Sub

I put a line in there to pop up a message box with the value of IsObject(Input_Two), and it always comes up False, but the Input_two object is on the page. It just seems that this code is executing before the page finishes loading. Any suggestions?

Thanks,
Rich
 
Try including that one in window_onfocus instead..and let us know.. Thank you...
RR

 
Thanks for quick response. I tried your suggestion...it still returns false for the IsObject call.

Rich
 
Try this


Sub Window_OnLoad()
If IsObject(Document.all.Input_Two) Then
Document.all.Input_Two.focus
End If
End Sub Thank you...
RR

 
I tried that shortly before I gave up. That causes an error - object doesn't support this property or method.

Rich
 
Not sure if this is the problem, but make everything in the appropriate Case and try..

Want only in VBScript ? Thank you...
RR

 
I found an alternate solution. I have another input object on the page. If this other one has anything in it, then I can safely assume that the second input is to receive the focus. Thanks for your help anyway.

Rich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top