Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


onfocus & onblur events syntax to change backgroun

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

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> onfocus & onblur events syntax to change backgroun
  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 >>
 onfocus & onblur events syntax to change backgroun - 6/3/2001 11:58:37 AM   
  rahul27

 

Posts: 19
Score: 0
Joined: 5/23/2001
From: India
Status: offline
In VBScript, I am trying to use onfocus to change the background
color of a form field named T1 to green, Then onblur to change it
back to white. It's simple in VB, but I keep getting an 'Object
Required : T1' error in VBScript. I can put a MsgBox in the Sub
and it'll work fine.


sub T1_onfocus()
msgBox "Hello" 'Works fine
'(Now, how can I change the background color of the field?)
end sub
sub T1_onblur()
set T1.bgcolor="#FFFFFF"
end sub
 
 
Post #: 1
 
 Re: onfocus & onblur events syntax to change backgroun - 6/3/2001 11:59:56 AM   
  pedx

 

Posts: 16
Score: 0
Joined: 5/22/2001
From: USA
Status: offline
Hi

Here's the code

sub T1_onblur()
T1.style.backgroundColor = "white" 'you
can use FFFFFF if you want
end sub
sub T1_onfocus()
T1.style.backgroundColor = "green"
end sub

(in reply to rahul27)
 
 
Post #: 2
 
 
 
  

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 >> onfocus & onblur events syntax to change backgroun 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