Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Check if I'm in the right form

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,53990
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Check if I'm in the right form
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Check if I'm in the right form - 12/3/2007 8:05:44 AM   
  hamboy

 

Posts: 94
Score: 6
Joined: 7/11/2005
Status: offline
Hi , how can I check to see if I am in a certain form?
I want to code something like this:


If (objIE.Document.getElementByID("USER") == TRUE) Then
objIE.Document.getElementByID("USER").value = username
objIE.Document.getElementByID("PASSWORD").value = password
End if
 
 
Post #: 1
 
 RE: Check if I'm in the right form - 12/3/2007 11:19:07 PM   
  TNO


Posts: 1282
Score: 12
Joined: 12/18/2004
From: thenewobjective.com
Status: online
There is no way currently to check what your cursor is in, but you can put it where you want it:

objIE.Document.getElementByID("USER").focus

_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to hamboy)
 
 
Post #: 2
 
 RE: Check if I'm in the right form - 12/4/2007 2:18:37 AM   
  hamboy

 

Posts: 94
Score: 6
Joined: 7/11/2005
Status: offline
I want something to check that I am on the right webpage.

My problem is this, say for example, if you didin't login to gmail.com, then going to gmail.com will bring you to the login page.

However, if you were logged on, maybe from another window/session, then going to gmail.com will bring you directly to inbox.

My script currrently expects to login, but errors out if going to gmail.com brings you to inbox, not login page.

So I was wondering, if there's somethign I can test if an object is there, and will cause true.

like if getElementbyTag("USER") is found, set true, then do login, if not, then skip to the rest of the script

(in reply to TNO)
 
 
Post #: 3
 
 RE: Check if I'm in the right form - 12/4/2007 2:38:43 AM   
  ehvbs

 

Posts: 2200
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
Hi hamboy,

if the existence of an element with id "ID" really is a sufficient condition, then
you can do:

  Set oElm = document.getElementById( "ID" )
  If oElm Is Nothing Then
      ... wrong page ...
  Else
      ... expected page ...
  End If

Good luck!

ehvbs

(in reply to hamboy)
 
 
Post #: 4
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Check if I'm in the right form Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts