View Full Version : Text disappear
displaced
April 9th, 2003, 01:34 AM
Does anyone know how to make the text already in the input text box disappear when you click on it.
For example:
|enter email| - this is loaded when the page is loaded
|_________| - then disappears when you click to type
: : I thought it would be very simple, but i guess not : :
THANKS in advanced!
lostinbeta
April 9th, 2003, 01:39 AM
It is simple :)
cta.text = "enter e-mail";
cta.onSetFocus = function() {
this.text = "";
};
cta is the INSTANCE name of the textbox in this case (NOT VAR NAME!!!)
ahmed
April 9th, 2003, 01:40 AM
it's simple indeed :).. give your field the instance name 'myTextfield', and have this code on the parent timeline
myTextfield.onSetFocus = function() {
myTextfield.text = ""
}
lostinbeta
April 9th, 2003, 01:40 AM
copycat :P
ahmed
April 9th, 2003, 01:45 AM
lol
you beat me this time:-\
displaced
April 9th, 2003, 01:50 AM
Will i need the var name if it is needed for a php file
ahmed
April 9th, 2003, 01:52 AM
then you can say
you can simply go like myPHPvariable = myTextfield.text :)
displaced
April 9th, 2003, 01:56 AM
Thanks guys again for the fast advice!
ahmed
April 9th, 2003, 01:57 AM
dont thank me, thank lostinbeta :P :trout:
lostinbeta
April 9th, 2003, 02:22 AM
No thank ahmed :P :trout:
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.