PDA

View Full Version : setFocus and form Txt fields help



FlashPlaya
January 7th, 2005, 08:37 PM
Hey guys.. I am trying to build a form just like http://parque.nl If you go to there contact you will see what I am trying to do. I have it all working great, but I want the text not to change after the viewer inputs text.. Mine always takes out the text and go back to the default names if you go back and forth??

Thanks guys!!! :thumb:

here it is:) http://www.dyaddesigns.com/formTest.fla it is 2004

FlashPlaya
January 9th, 2005, 01:06 PM
No one can help me wit this???

glkngs
January 9th, 2005, 01:28 PM
Sure..
You'll have to check to see if the user has typed in some data.

name.onKillFocus = function(){
if(name.text =="" ){
name.text = "Name here";
}
}

if thats what you mean?

FlashPlaya
January 10th, 2005, 03:16 PM
thanks glkngs,
I already got it figured out.. with:

tF.text = "First Name";
// when the textfield is focused
tF.onSetFocus = function() {
//changes box color
focus.gotoAndPlay(2);
if (this.text == "First Name") {
// if it contains the default text, empty the field
this.text = "";
}
};
// when the textfield loses focus
tF.onKillFocus = function() {
//changes box color back
focus.gotoAndPlay(21);
if (this.text == "") {
// if it is empty, restore the default text
this.text = "First Name";
}
};

this is what I came up: http://www.dyaddesigns.com/BestMailer/emailer.htm